The format of an integer-type
variable depends on its minimum and maximum bounds.
· If both bounds are within the range -128..127 (Shortint), the
variable is stored as a signed byte.
· If both bounds are within the range 0..255 (Byte), the
variable is stored as an unsigned byte.
· If both bounds are within the range -32768..32767 (Smallint),
the variable is stored as a signed word.
· If both bounds are within the range 0..65535 (Word), the
variable is stored as an unsigned word.
· If both bounds are within the range -2147483648..2147483647 (Longint),
the variable is stored as a signed double word.
· If both bounds are within the range 0..4294967295 (Longword),
the variable is stored as an unsigned double word.
· Otherwise, the variable is stored as a signed quadruple word (Int64).
整数类型变量的格式取决于它的最大范围和最小范围:
· 如果两个范围都是
-128..127(Shortint),那么变量存储为一个单字节(8位,即1字节)。
· 如果两个范围都是
0..255(Byte),那么变量存储为无符号的单字节(8位,即1字节)。
· 如果两个范围都是
-32768..32767(Smallint),那么变量存储为一个单字(16位,即2字节)。
· 如果两个范围都是
0..65535(Word),那么变量存储位一个无符号的单字(16位,即2字节)。
· 如果两个范围都是
-2147483648..2147483647(Longint),那么变量存储为一个含符号的双字(32位,即4字节)。
· 如果两个范围都是
0..4294967295(Longword),那么变量存储为一个无符号的双字(32位,即4字节)。
· 否则,变量存储为含符号的四个字(Int64)(64位,即8字节)。