FLOATBITSTOINT(3G)
π FLOATBITSTOINT(3G) π
okay bestie, gather round, because we're doing the 3G manual page for floatBitsToInt and it is lowkey iconic. this one's short, it's sweet, and it's literally just "hey what if your float was secretly an int this whole time". no cap.
β¨ NAME β¨
floatBitsToInt β produce the encoding of a floating point value as an integer
πΈ DECLARATION πΈ
bestie look at these signatures, they're giving precision:
genIType floatBitsToInt(genType x);
genUType floatBitsToUint(genType x);
π PARAMETERS π
xβ the value whose floating point encoding you want back. hand it over, we're reading its bits π
π DESCRIPTION π
okay so here's the tea. floatBitsToInt and floatBitsToUint return the encoding of their floating-point parameters as int or uint, respectively. the floating-point bit-level representation is preserved. that's it, that's the whole vibe β no rounding, no converting the number, we're converting the bits. the way that it just hands you the raw encoding, obsessed. π«Ά
π VERSION SUPPORT π
the OpenGL Shading Language Version tea, spilled:
floatBitsToInt- OpenGL Shading Language Version
1.10β- 1.20β-1.30β-1.40β-1.50β-3.30ββ4.00ββ4.10ββ4.20ββ4.30ββ4.40ββ4.50ββ
- OpenGL Shading Language Version
floatBitsToUInt- OpenGL Shading Language Version
1.10β- 1.20β-1.30β-1.40β-1.50β-3.30ββ4.00ββ4.10ββ4.20ββ4.30ββ4.40ββ4.50ββ
- OpenGL Shading Language Version
so basically it's-for 1.10 all the way through 1.50, and then3.30shows up and it'sβforever after. glow up era. π
π¦ SEE ALSO π¦
intBitsToFloat(),uintBitsToFloat
π 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
and that's the page, bestie!! this came from [FIXME: source] and it's dated 01/03/2018, and it's the FLOATBITSTOINT(3G) manual, so now you know. go forth and reinterpret your floats. periodt. πβ¨
π¦ 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