MODF(3G)
π MODF(3G) β the modf page, bestie edition π
okay so this is modf, and it lives in the 3G manual, which is the OpenGL Shading Language corner of the universe β¨ (the header calls the manual [FIXME: manual], iconic placeholder behaviour, we love her π).
πΈ NAME πΈ
modf β separate a value into its integer and fractional components π
β¨ DECLARATION β¨
bestie here is the actual signature, copy it exactly okay, no typos, no vibes-based guessing π«Ά
genType modf(genType x, out genType i);
genDType modf(genDType x, out genDType i);
π PARAMETERS π
xβ this is the value you wanna separate, the poor little thing is getting split in half πout iβ a variable that receives the integer part of the argument. note theoutβ she's an output, she's the one catching the integer half π«΄
π DESCRIPTION π
so modf takes a floating point value x and goes βοΈ and splits it into its integer part and its fractional part. the fractional part is what gets returned from the function (main character energy, she comes back out front), and the integer part (as a floating point quantity, ok, not an int, don't come for me) gets returned in the output parameter i. two halves, two delivery methods, one very efficient little function, we stan π
π VERSION SUPPORT π
this is the whole vibe check of "which GLSL version will even let you use this", and the answer is: genType has been around longer than genDType. periodt π
OpenGL Shading Language Version
modf (genType):
- 1.10 β
-(nope, not yet π) - 1.20 β
-(still nope) - 1.30 β
ββ - 1.40 β
ββ - 1.50 β
ββ - 3.30 β
ββ - 4.00 β
ββ - 4.10 β
ββ - 4.20 β
ββ - 4.30 β
ββ - 4.40 β
ββ - 4.50 β
ββ
modf (genDType):
- 1.10 β
-(no ma'am) - 1.20 β
- - 1.30 β
- - 1.40 β
- - 1.50 β
- - 3.30 β
- - 4.00 β
ββ (she arrives!! late but stunning π¦) - 4.10 β
ββ - 4.20 β
ββ - 4.30 β
ββ - 4.40 β
ββ - 4.50 β
ββ
π₯ SEE ALSO π₯
go say hi to her friends, they're all in the same friend group π«Ά
fract()floor()
π 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 π
Copyright Β© 2011-2014 Khronos Group
and that's the page, bestie π this one came from [FIXME: source] and it's dated 01/03/2018 β shoutout to the source for being a lil mysterious about itself, and to Khronos Group for the copyright, iykyk πΈβ¨π
π¦ 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