FINDLSB(3G)
π FINDLSB β okay bestie, let's find that bit π
Hi hello yes this is findLSB, a page from the 3G manual, and we are about to get intimately acquainted with the least significant bit that's chillin' at 1 in your integer. π¦
β¨ NAME β¨
findLSB β find the index of the least significant bit set to 1 in an integer
πΈ DECLARATION πΈ
Like, here's the vibe, literally the function signatures, do not touch a single character:
genIType findLSB(genIType value);
genIType findLSB(genUType value);
Two overloads, both iconic, both giving exactly what they need to give. π
π PARAMETERS π
valueβ the value whose bits we're scanning. That's it, that's the whole parameter. She's simple, she's effective. π
β¨ DESCRIPTION β¨
So findLSB returns the bit number of the least significant bit that is set to 1 in the binary representation of value. Basically: we're walking from the bottom up, looking for the first little 1 that says hi. π₯
And if value is zero? -1 will be returned. No bits are set, so there's nothing to find, and the function just tells you -1. Not a vibe, but it's honest. π
π VERSION SUPPORT π
Not every OpenGL Shading Language version was ready for this energy, so here's the receipts, one version at a time β function name findLSB:
- 1.10 β
-(nope) - 1.20 β
-(nope) - 1.30 β
-(nope) - 1.40 β
-(nope) - 1.50 β
-(nope) - 3.30 β
-(nope) - 4.00 β β (yes bestie)
- 4.10 β β
- 4.20 β β
- 4.30 β β
- 4.40 β β
- 4.50 β β
So like, 4.00 and onward? She ate. Everything before? Not invited to the function. π
π¦ SEE ALSO π¦
findMSB()
(yes, her more significant sister, go read that one too, iykyk π)
π 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
Okay that's the whole page, mwah, ily, go find some bits. This little number came from the [FIXME: source] crew and it's dated 01/03/2018 β FINDLSB(3G), 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