next up previous contents index
Next: Real types Up: Data types Previous: Data types

Integer types

The integer types predefined in Free Pascal are listed in table (1.1).

  

Type Range Size in bytes
Byte 0 .. 255 1
Shortint -127 .. 127 1
Integer -32768 .. 32767 2
Word 0 .. 65535 2
Longint -2147483648 .. 2147483648 4
Cardinalgif 0..4294967296 4
Table 1.1: Predefined integer types

Free Pascal does automatic type conversion in expressions where different kinds of integer types are used.

Free Pascal supports hexadecimal format the same way as Turbo Pascal does. To specify a constant value in hexadecimal format, prepend it with a dollar sign ($). Thus, the hexadecimal $FF equals 255 decimal.

In addition to the support for hexadecimal notation, Free Pascal also supports binary notation. You can specify a binary number by preceding it with a percent sign (%). Thus, 255 can be specified in binary notation as %11111111.



Michael Van Canneyt
Thu Sep 10 14:02:43 CEST 1998