MaxInt

From Lazarus wiki
Revision as of 22:00, 13 January 2012 by Rfc1394 (talk | contribs)
Jump to navigationJump to search

Maxint is a special const predefined by the compiler which declares the positive integer with the largest magnitude which the compiler can handle directly. This typically is the word size for the particular compiler, and varies according to the number of bits the processor for that machine uses. Note that maxint is an unsigned value.

The typical values of MAXINT are:

  • 8-bit and 16-bit machines, 2**16-1: 65,535
  • 32-bit machines, 2**32-1: 4,294,967,295
  • 64-bit machines, 2**64-1: 18,446,744,073,709,551,615

Maxint can be overridden with a user-defined value.