DOKK / manpages / debian 10 / allegro4-doc / fixtoi.3alleg4.en
fixtoi(3alleg4) Allegro manual fixtoi(3alleg4)

fixtoi - Converts a fixed point to integer with rounding. Allegro game programming library.

#include <allegro.h>

int fixtoi(fixed x);

Converts fixed point to integer, rounding as required to the nearest integer. Example:


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);

itofix(3alleg4), ftofix(3alleg4), fixtof(3alleg4), fixfloor(3alleg4), fixceil(3alleg4), ex12bit(3alleg4), ex3buf(3alleg4), ex3d(3alleg4), exblend(3alleg4), excustom(3alleg4), exlights(3alleg4), exspline(3alleg4), exstars(3alleg4), exupdate(3alleg4)

version 4.4.2 Allegro