al_fixfloor(3alleg5)

πŸ“¦
version 5.2.11.3 Β· 4 versions
, in debian trixie, ubuntu questing, ubuntu resolute, ubuntu stonking

πŸ’– al_fixfloor β€” Allegro 5 API πŸ’–

okay bestie, welcome to the al_fixfloor(3alleg5) page, straight out of the Allegro reference manual πŸŽ€ this one's a little math-y but it's lowkey adorable, i promise. it's giving "round down and never look back" energy ✨


🌸 SYNOPSIS 🌸

#include <allegro5/allegro.h>

int al_fixfloor(al_fixed x);

like, that's it. one function, one argument, no drama πŸ’…


πŸ¦‹ DESCRIPTION πŸ¦‹

so what does it actually do? al_fixfloor returns the greatest integer that is not greater than x. in normal human words: it rounds towards negative infinity. it always scooches down, never up, no matter what. periodt πŸ’€

here's the example from the page, verbatim, no cap:

int result;

/* This will put 33 into `result'. */
result = al_fixfloor(al_itofix(100) / 3);

/* And this will round down to 16. */
result = al_fixfloor(al_itofix(100) / 6);

so the first one lands 33 in result, and the second one rounds down to 16. the way that math just *works*… obsessed πŸ˜­πŸ’–


πŸ‘‘ SEE ALSO πŸ‘‘

go check those out too, they're the siblings fr fr 🫢


and that's the whole page, bestie ✨ this was al_fixfloor(3alleg5) from the Allegro reference manual β€” sending you all the fixed-point floor vibes, mwah πŸ’‹πŸŒˆ

πŸ“¦ where this page comes from