LDEXP(3G)
β¨ LDEXP(3G) β¨
okay bestie, so this is ldexp β literally the glow-up function that takes a lil significand and a whole exponent and assembles a floating point number out of them. iconic. π
(it's page 3G if you were wondering, which is the OpenGL shading language manual section, iykyk β¨)
πΈ NAME πΈ
ldexp β assemble a floating point number from a value and exponent
π DECLARATION π
genType ldexp(genType x, genIType exp);
genDType ldexp(genDType x, genIType exp);
like. two of them. one for the regular girlies, one for the double girlies. slay π«Ά
π PARAMETERS π
xβ the value that's gonna serve as your source of significand. that's the lil guy getting scaled up π«out expβ the value used as your source of exponent. that's the power-of-two energy right there π
π¦ DESCRIPTION π¦
so ldexp builds a floating point number out of x and the matching integral exponent of two that's sitting in exp. and it returns:
significand β
2 exponent
which is, like, the whole vibe. you bring the significand, exp brings the twos, they combine, boom. π₯
β οΈ but listen β if this product is too large to be represented in the floating point type, the result is undefined. no cap. so don't be out here overflowing your float and then acting surprised, bestie π it's giving chaos and we do not want that.
π VERSION SUPPORT π
here's the vibe check on when these girlies actually showed up in the OpenGL Shading Language versions. (short version: not for a long minute, then all at once β¨)
β ldexp (genType)
- OpenGL Shading Language 1.10 β
- - OpenGL Shading Language 1.20 β
- - OpenGL Shading Language 1.30 β
- - OpenGL Shading Language 1.40 β
- - OpenGL Shading Language 1.50 β
- - OpenGL Shading Language 3.30 β
- - OpenGL Shading Language 4.00 β
β - OpenGL Shading Language 4.10 β
β - OpenGL Shading Language 4.20 β
β - OpenGL Shading Language 4.30 β
β - OpenGL Shading Language 4.40 β
β - OpenGL Shading Language 4.50 β
β
π ldexp (genDType)
- OpenGL Shading Language 1.10 β
- - OpenGL Shading Language 1.20 β
- - OpenGL Shading Language 1.30 β
- - OpenGL Shading Language 1.40 β
- - OpenGL Shading Language 1.50 β
- - OpenGL Shading Language 3.30 β
- - OpenGL Shading Language 4.00 β
β - OpenGL Shading Language 4.10 β
β - OpenGL Shading Language 4.20 β
β - OpenGL Shading Language 4.30 β
β - OpenGL Shading Language 4.40 β
β - OpenGL Shading Language 4.50 β
β
so yeah, 4.00 is when it ate and never looked back. periodt. π
π§ SEE ALSO π§
frexp()β the reverse-bestie, the one who takes apart the float. they're a matching set, your honor π
π 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 whole page, bestie!! π«Ά this was source [FIXME: source], dated 01/03/2018, living under LDEXP(3G) β go forth and assemble your floats responsibly, 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