fixtoi(3alleg4)

πŸ’– NAME πŸ’–

omg hi bestie, welcome to the fixtoi(3alleg4) page from the Allegro manual. This is your girl fixtoi β€” she converts a fixed point to integer with rounding. It's giving Allegro game programming library energy, periodt. πŸ’…


✨ SYNOPSIS ✨

okay so first you gotta include the Allegro header, then call her like this:

#include <allegro.h>

int fixtoi(fixed x);

That's it, no cap. 🫢


πŸ¦‹ DESCRIPTION πŸ¦‹

fixtoi converts fixed point to integer, rounding as required to the nearest integer. Literally that's the whole job. She's not messy, she rounds properly to the nearest integer. 🌸

Example, bestie:

int result;
/* This will put 33 into `result'. */
result = fixtoi(itofix(100) / 3);
/* But this will round up to 17. */
result = fixtoi(itofix(100) / 6);

🌈 SEE ALSO 🌈


mwah πŸ’‹ that's the whole fixtoi(3alleg4) page, brought to you by Allegro version 4.4.3. stay iconic, bestie 🫢✨