MOD(3G)

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

πŸ’– MOD(3G) β€” the mod() glow-up πŸ’–

okay bestie, so this is from the 3G manual section, and it's literally all about mod β€” computing the value of one parameter modulo another. yes, THE modulo. the one that makes your brain go brrr. let's get into it πŸ¦‹


✨ NAME ✨

mod β€” compute value of one parameter modulo another

it's giving "remainder but make it ✨floor✨" and we're obsessed.


πŸŽ€ DECLARATION πŸŽ€

here's the full roster, no cap β€” every single overload, exactly as it comes:

genType mod(genType x, float y);

genType mod(genType x, genType y);

genDType mod(genDType x, double y);

genDType mod(genDType x, genDType y);

four whole signatures. main character energy fr fr πŸ’…


🌸 PARAMETERS 🌸

  • x β€” Specify the value to evaluate.

that's the vibe. you hand it x, it does the thing. periodt.


🧚 DESCRIPTION 🧚

so mod returns the value of x modulo y. and like, the way it's actually computed is:

x - y * floor()(x/y)

not me writing it out exactly like that, because that IS exactly what the manpage says and we do not play with the math πŸ’€. it's floor-based, which is why it behaves differently from a plain truncating remainder β€” that's the whole personality of this function, lowkey iconic.


🌈 VERSION SUPPORT 🌈

okay so this is the part where the original had a big sparkly table, and we're gonna keep every single crumb of it because the facts do NOT change, only the vibe does πŸ’–

⭐ mod (genType)

supported βœ” in literally every OpenGL Shading Language version listed:

  • 1.10 βœ”
  • 1.20 βœ”
  • 1.30 βœ”
  • 1.40 βœ”
  • 1.50 βœ”
  • 3.30 βœ”
  • 4.00 βœ”
  • 4.10 βœ”
  • 4.20 βœ”
  • 4.30 βœ”
  • 4.40 βœ”
  • 4.50 βœ”

every single one. she ate and left no crumbs πŸ‘‘

πŸ’œ mod (genDType)

this one's a late bloomer, no shade:

  • 1.10 β€”
  • 1.20 β€”
  • 1.30 β€”
  • 1.40 β€”
  • 1.50 β€”
  • 3.30 β€”
  • 4.00 βœ”
  • 4.10 βœ”
  • 4.20 βœ”
  • 4.30 βœ”
  • 4.40 βœ”
  • 4.50 βœ”

so like, dash dash dash dash dash dash and THEN the glow-up at 4.00. we love a redemption arc πŸ¦‹


🫢 SEE ALSO 🫢

go check out the siblings bestie, they're family:

  • modf()
  • floor()

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 MOD(3G) from the [FIXME: source] source, dated 01/03/2018 β€” yeah the placeholder is still in there, we don't ask questions, we just vibe πŸ™ˆβœ¨ mwah, go forth and modulo responsibly πŸ’…πŸ’–

πŸ“¦ where this page comes from