Integer

From Lazarus wiki
Revision as of 07:50, 22 July 2005 by Rfc1394 (talk | contribs)
Jump to navigationJump to search

Integer is a standard type of the Pascal Programming language. It is used to define a whole number, as opposed to a real data type, which has a decimal point and may contain an exponent.

The size of an integer is dependent upon the word size of the target machine to which the compiler is to generate code and upon compiler switches in some cases. Typical sizes of integer generally are 16, 32 or 64 bits.

On older compilers, an integer was 16 bits, and represented values from 2**-16 through 2**16 -1, or -65,536 through 65,535. A similar data type, word, was sometimes used to define an unsigned integer (0..65536). In such cases where the compiler used a 16-bit integer type, 32-bit integers would usually be expressed by the data type long.

For I386 machines, an integer is generally defined as 32 bits, and encompasses the values of 2**-32 through 2**32 -1, or -4294967296 .. 4294967295. The latter value is also defined as the constant maxint.

On newer 64-bit processors an integer may be defined as a value of 2**-64 through 2**64-1, or -18446744073709551616 .. 18446744073709551615.