fixceil(3)

πŸ“¦ version 4.4.3.1, in fedora 43, fedora 44

✨ 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