[ < ] | [ > ] |  | [ << ] | [ Up ] | [ >> ] |  |  |  |  | [Top] | [Contents] | [Index] | [ ? ]

#### 8.2.3.5 Summary of Integer Types

Here is a summary of all integer types defined in GPC. The sizes and ranges are only typical values, valid on some, but not all platforms. Compatibility to GNU C however is guaranteed.

section 9.34 ByteInt
  signed 8-bit integer type, ``-128..128'`,
  compatible to ``signed char'` in GNU C.
section 9.33 ByteCard
  unsigned 8-bit integer type, ``0..255'`,
  compatible to ``unsigned char'` in GNU C.
section 9.251 ShortInt
  signed 16-bit integer type, ``-32768..32767'`,
  compatible to ``short int'` in GNU C.
section 9.250 ShortCard
  unsigned 16-bit integer type, ``0..65535'`,
  compatible to ``unsigned short int'` in GNU C.
section 9.125 Integer
  signed 32-bit integer type, ``-2147483648..2147483647'`,
  compatible to ``int'` in GNU C.
section 9.37 Cardinal
  unsigned 32-bit integer type, ``0..4294967295'`,
  compatible to ``unsigned int'` in GNU C.
section 9.156 MedInt
  signed 32-bit integer type, ``-2147483648..2147483647'`,
  compatible to ``long int'` in GNU C.
section 9.155 MedCard
  unsigned 32-bit integer type, ``0..4294967295'`,
  compatible to ``unsigned long int'` in GNU C.
section 9.144 LongInt
  signed 64-bit integer type, ``-9223372036854775808..9223372036854775807'`,
  compatible to ``long long int'` in GNU C.
section 9.138 LongCard
  unsigned 64-bit integer type, ``0..18446744073709551615'`,
  compatible to ``unsigned long long int'` in GNU C.
section 9.141 LongestInt
  signed 64-bit integer type, ``-9223372036854775808..9223372036854775807'`.
section 9.140 LongestCard
  unsigned 64-bit integer type, ``0..18446744073709551615'`.
section 9.46 Comp
  signed 64-bit integer type, ``-9223372036854775808..9223372036854775807'`.
section 9.259 SmallInt
  signed 16-bit integer type, ``-32768..32767'`.
section 9.258 SizeType
  integer type (usually unsigned) to represent the size of objects in memory
section 9.208 PtrDiffType
  signed integer type to represent the difference between two positions in memory
section 9.209 PtrInt
  signed integer type of the same size as a pointer
section 9.207 PtrCard
  unsigned integer type of the same size as a pointer

To specify the number of bits, use

``Integer (n)'`
  signed n-bit integer type.
``Cardinal (n)'`
  unsigned n-bit integer type.
``Word (n)'`
  unsigned n-bit integer type.

    program IntegerTypesDemo (Output);

    var
      ByteVar: Byte;
      ShortIntVar: ShortInt;
      Foo: MedCard;
      Big: LongestInt;

    begin
      ShortIntVar := 1000;
      Big := MaxInt * ShortIntVar;
      ByteVar := 127;
      Foo := 16#deadbeef
    end.

See also: section 8.2.10.1 Subrange Types.

[ < ] | [ > ] |  | [ << ] | [ Up ] | [ >> ] |  |  |  |  | [Top] | [Contents] | [Index] | [ ? ]

This document was generated by Frank Heckenbach on May, 10 2002 using texi2html