ROUNDEVEN(3G)
π roundEven β find the nearest even integer to the parameter π
okay bestie, this is roundEven(3G) β the section 3G of the manual, so it's a GLSL shading-language thing, not a command you run in your shell. no cap. π
β¨ NAME β¨
roundEven β find the nearest even integer to the parameter π
πΈ DECLARATION πΈ
here's the signature, exactly as written, don't touch a character:
genType roundEven(genType x);
genDType roundEven(genDType x);
π¦ PARAMETERS π¦
xβ Specify the value to evaluate. that's the whole assignment, girl. hand it a value, it does the thing. π
π DESCRIPTION π
so roundEven returns a value equal to the nearest integer to x. but here's the twist that makes it the main character: the fractional part of 0.5 will round toward the nearest even integer. for example, both 3.5 and 4.5 will round to 4.0. yes literally both. that's not a typo, that's the entire point of the function. it's giving banker's rounding energy. β¨
π₯ VERSION SUPPORT π₯
the original ships this as a big gorgeous grid of OpenGL Shading Language Versions, so let me unspool it for you cell by cell, no details lost. the versions we're checking are: 1.10, 1.20, 1.30, 1.40, 1.50, 3.30, 4.00, 4.10, 4.20, 4.30, 4.40, 4.50. π«Ά
π roundEven (genType)
1.10β-(nope, not yet)1.20β-(still nope)1.30ββ1.40ββ1.50ββ3.30ββ4.00ββ4.10ββ4.20ββ4.30ββ4.40ββ4.50ββ
π« roundEven (genDType)
1.10β-1.20β-1.30β-1.40β-1.50β-3.30β-4.00ββ4.10ββ4.20ββ4.30ββ4.40ββ4.50ββ
so the genType girlies got in at 1.30, and the genDType girlies had to wait all the way until 4.00. we love a late bloomer. ππ
π SEE ALSO π
floor(), round() β go say hi, they're all in the same friend group. π§
π COPYRIGHT π
Copyright Β© 2011-2014 Khronos Group. This material may be distributed subject to the terms and conditions set forth in the Open Publication License, v 1.0, 8 June 1999. http://opencontent.org/openpub/.
Copyright Β© 2011-2014 Khronos Group
bestie this page came from[FIXME: source]and it's dated01/03/2018, manual section3G, so if you're citing it, that's the tea. π β¨
okay that's the whole page, ate and left no crumbs, go forth and round to the nearest even integer fr fr ππ
π¦ where this page comes from
- ubuntu jammy: opengl-4-man-doc 1.0~svn33624-1 Β· SGI-Free-Software-B-License-2
- ubuntu noble: opengl-4-man-doc 1.0~svn33624-1 Β· SGI-Free-Software-B-License-2
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms