logo
Free, unlimited AI code reviews that run on commit
git-lrc git-lrc GitHub Install Now We'd appreciate a star git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt

al_itofix - Allegro 5 API

Description

       Converts an integer to fixed point.  This is the same thing as x<<16.  Remember that overflows (trying to
       convert  an  integer greater than 32767) and underflows (trying to convert an integer lesser than -32768)
       are not detected even in debug builds!  The values simply “wrap around”.

       Example:

              al_fixed number;

              /* This conversion is OK. */
              number = al_itofix(100);
              assert(al_fixtoi(number) == 100);

              number = al_itofix(64000);

              /* This check will fail in debug builds. */
              assert(al_fixtoi(number) == 64000);

Name

       al_itofix - Allegro 5 API

Return Value

       Returns the value of the integer converted to fixed point ignoring overflows.

See Also

al_fixtoi(3alleg5), al_ftofix(3alleg5), al_fixtof(3alleg5).

Allegro reference manual                                                                      al_itofix(3alleg5)

Synopsis

              #include <allegro5/allegro.h>

              al_fixed al_itofix(int x);

See Also