1itofix(3)                       Allegro manual                       itofix(3)
2
3
4

NAME

6       itofix  -  Converts an integer to fixed point. Allegro game programming
7       library.
8

SYNOPSIS

10       #include <allegro.h>
11
12
13       fixed itofix(int x);
14

DESCRIPTION

16       Converts an integer to fixed point. This is the same  thing  as  x<<16.
17       Remember  that  overflows  (trying  to  convert an integer greater than
18       32767) and underflows (trying to convert an integer lesser than -32768)
19       are not detected even in debug builds! The values simply "wrap around".
20       Example:
21
22          fixed number;
23          /* This conversion is OK. */
24          number = itofix(100);
25          ASSERT(fixtoi(number) == 100);
26          number = itofix(64000);
27          /* This check will fail in debug builds. */
28          ASSERT(fixtoi(number) == 64000);
29

RETURN VALUE

31       Returns the value of the integer  converted  to  fixed  point  ignoring
32       overflows.
33
34

SEE ALSO

36       fixtoi(3),   ftofix(3),   fixtof(3),  ex12bit(3),  ex3buf(3),  ex3d(3),
37       exblend(3),   excustom(3),   exfixed(3),   exlights(3),    exspline(3),
38       exsprite(3), exstars(3)
39
40
41
42Allegro                          version 4.4.3                       itofix(3)
Impressum