VSI Fortran provides the following intrinsic data types: o INTEGER (4 kind type parameters) - a whole number o REAL (3 kind type parameters) - a floating point number (a whole number, a decimal fraction, or a combination) o DOUBLE PRECISION - a REAL kind type parameter that has more than twice the degree of accuracy in its representation, and greater range o COMPLEX (3 kind type parameters) - a pair of REAL values representing a complex number (the first part of the number is the real part, the second is the imaginary part) o DOUBLE COMPLEX - a COMPLEX kind type parameter with DOUBLE PRECISION real and imaginary parts o LOGICAL (4 kind type parameters)- a logical value, .TRUE. or .FALSE. o CHARACTER - a sequence of characters o BYTE - a one-byte value equivalent to INTEGER(KIND=1)
1 – CHARACTER
A character string is a contiguous sequence of bytes in memory. A character string is specified by two attributes: the address of the first byte of the string and the length of the string in bytes. The length of the string must be in the range 1 through 65535. Hollerith constants are stored internally, one character per byte.
2 – COMPLEX
Real and complex numbers are floating-point representations. COMPLEX(KIND=4) (or COMPLEX*8) data is eight contiguous bytes aligned on an arbitrary byte boundary. The low-order four bytes contain REAL(KIND=4) (or REAL*4) data that represents the real part of the complex number. The high-order four bytes contain REAL data that represents the imaginary part of the complex number. For information on the ranges of REAL data, see REAL (within the DATA CONSTANTS section of online Help). DOUBLE COMPLEX (COMPLEX(KIND=8) or COMPLEX*16) data is 16 contiguous bytes aligned on an arbitrary byte boundary. The low-order bytes contain DOUBLE PRECISION data that represents the real part of the complex number. The high-order eight bytes contain DOUBLE PRECISION data that represents the imaginary part of the complex data. For information on the ranges of DOUBLE PRECISION data, see DOUBLE_PRECISION (within the DATA CONSTANTS section of online Help). COMPLEX(KIND=16) (or COMPLEX*32) data is 32 contiguous bytes aligned on an arbitrary byte boundary. The low-order bytes contain REAL(KIND=16) (or REAL*16) data that represents the real part of the complex number. The high-order bytes contain REAL*16 data that represents the imaginary part of the complex number. For information on the ranges of REAL*16 data, see REAL (within the DATA CONSTANTS section of online Help).
3 – INTEGER
Integer numbers are whole numbers. For information on the ranges of INTEGER data, see INTEGER (within the DATA CONSTANTS section of online Help). INTEGER*2, INTEGER*4, and INTEGER*8 values are stored in two's complement form. Note that logical data type ranges correspond to their comparable integer data type ranges. For example, in LOGICAL*2 L, the range for L is the same as the range for INTEGER*2 integers.
4 – LOGICAL
Logical values start on an arbitrary byte boundary and are stored in one, two, or four contiguous bytes. The low-order bit (bit 0) determines the value. If bit 0 is set, the value is .TRUE.; if bit 0 is clear, the value is .FALSE. The remaining bits are undefined. When a logical value is stored in memory, all of its bits are stored. For example, consider the following: LOGICAL*4 L1, L2, L3 L1 = L2 .AND. L3 This example does a full 32-bit AND of L2 and L3, and stores all 32 resulting bits in L1.
5 – REAL
Real and complex numbers are floating-point representations. The exponent for REAL(KIND=4) (or REAL*4) (F_floating) and DOUBLE PRECISION (REAL(KIND=8) or REAL*8) (D_floating) formats is stored in binary excess 128 notation. Binary exponents from -127 to 127 are represented by the binary equivalents of 1 through 255. The exponent for the DOUBLE PRECISION G_floating format and T_floating format is stored in binary excess 1024 notation. The exponent for the REAL*16 format is stored in binary excess 16384 notation. In DOUBLE PRECISION (G_floating) format, binary exponents from -1023 to 1023 are represented by the binary equivalents of 1 through 2047. In REAL*16 format, binary exponents from -16383 to 16383 are represented by the binary equivalents of 1 through 32767. For floating-point format, fractions are represented in sign-magnitude notation, with the binary radix point to the left of the most significant bit for F_floating, D_floating, and G_floating, and to the right of the most significant bit for S_floating and T_floating. Fractions are assumed to be normalized, and therefore the most significant bit is not stored. This bit is assumed to be 1 unless the exponent is 0. in which case the value represented is either zero or is a reserved operand. REAL(KIND=4) (or REAL*4) numbers occupy four contiguous bytes and the precision is approximately one part in 2**23, that is, typically 7 decimal digits. DOUBLE PRECISION (D_floating) numbers occupy eight contiguous bytes and the precision is approximately one part in 2**55, that is, typically 16 decimal digits. DOUBLE PRECISION G_floating numbers occupy eight contiguous bytes and the precision is approximately one part in 2**52, that is, typically 15 decimal digits. REAL*16 (H_floating) numbers occupy sixteen contiguous bytes and the precision is approximately 2**112, that is, typically 33 decimal digits. For more information on real data type ranges, see DATA CONSTANTS REAL and DATA CONSTANTS DOUBLE_PRECISION in this Help file.