INTBITSTOFLOAT(3G)

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

πŸ’– INTBITSTOFLOAT β€” the 3G girlies' guide πŸ’–

okay so bestie, we're in section 3G of the manual and today's main character is intBitsToFloat (and its understudy _uintBitsToFloat, we love her too). πŸŽ€


✨ NAME ✨

intBitsToFloat, _uintBitsToFloat β€” produce a floating point using an encoding supplied as an integer


🌸 DECLARATION 🌸

no cap, here's the signature, copy it exactly bestie:

genType intBitsToFloat(genIType x);

genType uintBitsToFloat(genUType x);

πŸ¦‹ PARAMETERS πŸ¦‹

  • x β€” Specifies the bit encoding to return as a floating point value. it's giving "here's some bits, now make them a float" πŸ’…

πŸ’œ DESCRIPTION πŸ’œ

so intBitsToFloat and uintBitsToFloat return the encoding you passed in parameter x as a floating-point value. that's the whole vibe. you hand over bits, you get back a float. iconic. ✨

now listen closely because this part matters:

  • If the encoding of a NaN is passed in x, it will not signal and the resulting value will be undefined. 😭 undefined behaviour, bestie, that's the "we don't know what happens" zone, tread carefully.
  • If the encoding of a floating point infinity is passed in parameter x, the resulting floating-point value is the corresponding (positive or negative) floating point infinity. ♾️ so that one's actually well-behaved.

πŸ‘‘ VERSION SUPPORT πŸ‘‘

here's the vibe check on which OpenGL Shading Language Versions are serving for the function name intBitsToFloat:

  • intBitsToFloat:
    • OpenGL Shading Language Version 1.10 β€” - (nope, not yet 🚫)
    • OpenGL Shading Language Version 1.20 β€” - 🚫
    • OpenGL Shading Language Version 1.30 β€” - 🚫
    • OpenGL Shading Language Version 1.40 β€” - 🚫
    • OpenGL Shading Language Version 1.50 β€” - 🚫
    • OpenGL Shading Language Version 3.30 β€” βœ” βœ…
    • OpenGL Shading Language Version 4.00 β€” βœ” βœ…
    • OpenGL Shading Language Version 4.10 β€” βœ” βœ…
    • OpenGL Shading Language Version 4.20 β€” βœ” βœ…
    • OpenGL Shading Language Version 4.30 β€” βœ” βœ…
    • OpenGL Shading Language Version 4.40 β€” βœ” βœ…
    • OpenGL Shading Language Version 4.50 β€” βœ” βœ…

so basically she showed up in 3.30 and has been that girl ever since. 🌈


🫢 SEE ALSO 🫢

  • floatBitsToInt(),
  • floatBitsToUint,
  • isnan(),
  • isinf()

go read those too, iykyk. πŸ”₯


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


okay that's the whole page bestie, you ate that πŸ’…βœ¨ and just so you know where this came from: this was the [FIXME: source] situation, dated 01/03/2018, filed under INTBITSTOFLOAT(3G). slay, go forth and cast those bits πŸŽ€πŸ¦‹πŸ’–

πŸ“¦ where this page comes from