Integer data is used to store integers. Turbo Pascal supports five predefined integers, namely shortint integer, integer, longint integer, byte, and word. Turbo Pascal used the same names as their theorists. Each type specifies the corresponding integer value range and the number of bytes of memory occupied.
Type a numeric range in byte format.
Shortint-128 ...1271signed 8 bits
Integer -32768...32767 2 Signed 16 bits
Longint-2147483648 ... 2147483647 4 Signed 32 bits.
Byte 0..255 1 unsigned 8-bit word 0..655352 unsigned 16 bits.
Description: Integer -32768...32767 2 (number of bytes) signed 16 bits (format)
Turbo Pascal specifies two predefined integer constant table identifiers maxint and maxlongint, which respectively represent some constant values. maxint is 32767 and maxlongint is 2 147483647, and their types are Integer and longint respectively.
2. Real type
Real data uses classes to store real numbers. Turbo Pascal supports five predefined real number types, namely, real (basic real number type), single (single precision real number type), double (double precision real number type), extended (extended real number type) and comp (assembly real number type). Turbo Pascal uses the same name as their identifiers respectively. Each type specifies the corresponding real number range, the number of memory bytes occupied and the precision they can achieve.
Number of significant digits of numeric range type in bytes.
real2.9e-39.. 1.7e38 6 1 1.. 12
Single1.5e-45 ... 3.4e38 47 ... 8
Shuang 5.0e-324 ..1.7e308 815 ..16
Extension 3.4e-4951..1.1e49321019.20.
comp-2**63+ 1..2**63- 1 8 19..20
Describe real2.9e-39.. 1.7e38 6 (number of bytes) 1 1.. 12 (significant number).
Turbo Pascal supports two code generation modes for actual operation: software simulation mode and 80x87 floating-point mode. Except for real, which can run directly in the software simulation mode, all other types must run in the 80x87 floating-point mode, and compile instructions {$ n+, e+} should be added to the program header.
3. Boolean type
Boolean data is used to store logical values (Boolean values). There are only two Boolean values: false and true. The serial number of false is 0, and the serial number of true is 1. False and true are predefined constant identifiers, representing logical false and logical true respectively. Boolean is a Boolean type identifier.
4. Character type
Char is used as an identifier for character types. Character types must be enclosed in single quotes. When letters are used as character types, the case is not equivalent, and only one character in single quotation marks is allowed for character types, otherwise it is a string.