fixfloor(3alleg4)
β¨ fixfloor(3alleg4) β¨
okay bestie, welcome to the Allegro manual π this one's a tiny lil function page and honestly? it's giving "short but essential". let's go π
πΈ NAME πΈ
fixfloor β returns the greatest integer not greater than x. from the Allegro game programming library, no cap π
π¦ SYNOPSIS π¦
#include <allegro.h>
int fixfloor(fixed x);
π DESCRIPTION π
so basically fixfloor hands you back the greatest integer that is not greater than x. that's the whole vibe. lowkey what it actually means is: it rounds towards negative infinity π«Ά like, always down, always toward the void, never toward zero. periodt.
here's the example, bestie, look at it:
int result;
/* This will put 33 into `result'. */
result = fixfloor(itofix(100) / 3);
/* And this will round down to 16. */
result = fixfloor(itofix(100) / 6);
see how itofix(100) / 3 slides a clean 33 into result? iconic. and itofix(100) / 6? that one rounds down to 16. the way it just... floors it πβ¨
heads up: this is fixed-point math, not float math β thefixedtype anditofixare the Allegro way of doing decimals without decimals. iykyk π
π SEE ALSO π
fixtoi(3alleg4)β the convert-to-int bestiefixceil(3alleg4)β same energy but it goes up instead π
and that's the whole page, babes π¦ this was pulled straight from Allegro version 4.4.3, dated with love, and it lives under the name fixfloor(3alleg4). go floor something. slay π
π
π¦ where this page comes from
- debian bookworm: allegro4-doc 2:4.4.3.1-3 Β· Allegro-gift-ware
- debian trixie: allegro4-doc 2:4.4.3.1-5 Β· Allegro-gift-ware
- ubuntu jammy: allegro4-doc 2:4.4.3.1-2 Β· Allegro-gift-ware
- ubuntu noble: allegro4-doc 2:4.4.3.1-4.1build3 Β· Allegro-gift-ware
- ubuntu questing: allegro4-doc 2:4.4.3.1-6
- ubuntu resolute: allegro4-doc 2:4.4.3.1-7 Β· Allegro-gift-ware
- ubuntu stonking: allegro4-doc 2:4.4.3.1-9 Β· Allegro-gift-ware
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms