1al_itofix(3) Library Functions Manual al_itofix(3)
2
3
4
6 al_itofix
7
9 #include <allegro5/allegro.h>
10
11 al_fixed al_itofix(int x);
12
14 Converts an integer to fixed point. This is the same thing as x<<16.
15 Remember that overflows (trying to convert an integer greater than
16 32767) and underflows (trying to convert an integer lesser than –32768)
17 are not detected even in debug builds! The values simply “wrap around”.
18
19 Example:
20
21 al_fixed number;
22
23 /* This conversion is OK. */
24 number = al_itofix(100);
25 assert(al_fixtoi(number) == 100);
26
27 number = al_itofix(64000);
28
29 /* This check will fail in debug builds. */
30 assert(al_fixtoi(number) == 64000);
31
33 Returns the value of the integer converted to fixed point ignoring
34 overflows.
35
37 al_fixtoi(3), al_ftofix(3), al_fixtof(3).
38
39
40
41Allegro reference manual al_itofix(3)