fixceil(3)
β¨ fixceil(3) β¨
okay bestie, welcome to the Allegro manual, the game programming library that literally raised so many of us π this one's a tiny little math baddie and she is iconic
π NAME π
fixceil β returns the smallest integer not less than x. no cap, that's the whole job. from the Allegro game programming library, obvi π
π¦ SYNOPSIS π¦
#include <allegro.h>
int fixceil(fixed x);
like, that's it. one include, one function, zero drama β¨
πΈ DESCRIPTION πΈ
so fixceil gives you the smallest integer that is not less than x. which is just a fancy way of saying it rounds towards positive infinity β¬οΈβ¬οΈβ¬οΈ it never goes down, she only goes up, main character energy fr fr π
here's the example, and yes you should absolutely read it because it's giving chef's kiss:
int result;
/* This will put 34 into `result'. */
result = fixceil(itofix(100) / 3);
/* This will round up to 17. */
result = fixceil(itofix(100) / 6);
see how itofix(100) / 3 lands you on 34 in result? π and then dividing by 6 instead rounds up to 17? it's the same function just doing her little upward thing, obsessed honestly ππ
lowkey reminder bestie: it rounds toward positive infinity, not toward zero, not to nearest. up only. periodt.
β SEE ALSO β
go read those too, they're the rest of the friend group π«Ά
and that's the page!! brought to you by Allegro, version 4.4.3 π mwah, love u, go write something cute ππ§β¨
π¦ where this page comes from
- fedora 43: allegro-devel 4.4.3.1-18.fc43 Β· Giftware
- fedora 43: allegro-devel 4.4.3.1-18.fc43 Β· Giftware
- fedora 44: allegro-devel 4.4.3.1-20.fc44 Β· Giftware
- fedora 44: allegro-devel 4.4.3.1-20.fc44 Β· Giftware
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms