LOG2(3G)
π LOG2 β the base 2 logarithm one π
okay bestie, we're in the 3G manual section, and today's main character is log2. she's giving "math girlie who knows exactly what she's about" and honestly? obsessed. β¨
πΈ NAME πΈ
log2 β returns the base 2 logarithm of the parameter. that's it, that's the whole vibe. π
β¨ DECLARATION β¨
genType log2(genType x);
like. look at her. so clean. so simple. no cap. π¦
π PARAMETERS π
xβ the value you wanna take the base 2 logarithm of. just hand her the number and let her cook. π
π DESCRIPTION π
so log2 returns the base 2 logarithm of $x$, aka the value $y$ that satisfies this lil equation:
$x = 2^y$
literally the whole point. you give her a number, she tells you what power of 2 gets you there. iconic behavior. π
β οΈ BUT WAIT β the result is undefined if $x \leq 0$. like, do not. she cannot help you there. not her problem. it's giving undefined for a reason, bestie. π
π VERSION SUPPORT π
here's the vibe check across every OpenGL Shading Language version, and lemme tell you β she ate. every single one. no skips, no gaps, just β¨consistencyβ¨:
log2in OpenGL Shading Language version 1.10 β βlog2in OpenGL Shading Language version 1.20 β βlog2in OpenGL Shading Language version 1.30 β βlog2in OpenGL Shading Language version 1.40 β βlog2in OpenGL Shading Language version 1.50 β βlog2in OpenGL Shading Language version 3.30 β βlog2in OpenGL Shading Language version 4.00 β βlog2in OpenGL Shading Language version 4.10 β βlog2in OpenGL Shading Language version 4.20 β βlog2in OpenGL Shading Language version 4.30 β βlog2in OpenGL Shading Language version 4.40 β βlog2in OpenGL Shading Language version 4.50 β β
twelve outta twelve. she's been here since 1.10 and she's still standing. main character energy fr fr. π₯
π§ SEE ALSO π§
if you liked log2, you're gonna wanna meet her friends:
exp()log()exp2()
the whole math squad. go say hi. π«Ά
π 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 (yes, again) π
Copyright Β© 2011-2014 Khronos Group
and that's the page, bestie!! π
this was pulled from the [FIXME: source] and it's dated 01/03/2018, still living her best life in the LOG2(3G) era. mwah. πβ¨
π¦ 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