LOG2(3G)

πŸ“¦
version 1.0~svn33624 Β· 4 versions
, in ubuntu jammy, ubuntu noble

πŸ’– 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✨:

  • log2 in OpenGL Shading Language version 1.10 β€” βœ”
  • log2 in OpenGL Shading Language version 1.20 β€” βœ”
  • log2 in OpenGL Shading Language version 1.30 β€” βœ”
  • log2 in OpenGL Shading Language version 1.40 β€” βœ”
  • log2 in OpenGL Shading Language version 1.50 β€” βœ”
  • log2 in OpenGL Shading Language version 3.30 β€” βœ”
  • log2 in OpenGL Shading Language version 4.00 β€” βœ”
  • log2 in OpenGL Shading Language version 4.10 β€” βœ”
  • log2 in OpenGL Shading Language version 4.20 β€” βœ”
  • log2 in OpenGL Shading Language version 4.30 β€” βœ”
  • log2 in OpenGL Shading Language version 4.40 β€” βœ”
  • log2 in 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 Β© 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


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