VMS Help
FORTRAN, Data, Types
*Conan The Librarian (sorry for the slow response - running on an old VAX)
|
|
The Fortran data types are as follows:
o Integer - A whole number
o REAL (REAL*4) - A single-precision floating-point number
(a whole number or a decimal fraction or
a combination)
o DOUBLE PRECISION (REAL*8) - A double-precision floating-point
number (like REAL*4, but with twice the
degree of accuracy in its representation)
o REAL*16 - A quad-precision floating-point number (like REAL*4,
but with four times the degree of accuracy in its
representation.)
o COMPLEX (COMPLEX*8) - A pair of REAL*4 values representing
a complex number (the first part of the number is
the real part, the second is the imaginary part)
o COMPLEX*16 (DOUBLE COMPLEX) - Similar to complex, but with
twice the degree of accuracy in its representation
(its real or imaginary part must be a REAL*8)
o Logical - A logical value, .TRUE. or .FALSE.
o Character - A sequence of characters
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.
Real and complex numbers are floating-point representations.
COMPLEX*8 (F_floating) data is eight contiguous bytes aligned on an
arbitrary byte boundary. The low-order four bytes contain REAL*4
data that represents the real part of the complex number. The
high-order four bytes contain REAL*4 data that represents the
imaginary part of the complex number.
COMPLEX*16 (D_floating) data is 16 contiguous bytes aligned on an
arbitrary byte boundary. The low-order bytes contain REAL*8
(D_floating) data that represents the real part of the complex
data. The high-order eight bytes contain REAL*8 (D_floating) data
that represents the imaginary part of the complex data.
COMPLEX*16 (G_floating) data is 16 contiguous bytes aligned on an
arbitrary byte boundary. The low-order bytes contain REAL*8
(G_floating) data that represents the real part of the complex
data. The high-order eight bytes contain REAL*8 (G_floating) data
that represents the imaginary part of the complex data.
Integer values are stored in two's complement form; INTEGER*2 uses
two contiguous bytes and must be in the range -32768 to 32767.
INTEGER*4 uses four contiguous bytes and must be in the range
-2147483648 to 2147483647. If the value is in the range of an
INTEGER*2, then the first word can be referenced as an INTEGER*2
value.
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.
Real and complex numbers are floating-point representations.
The exponent for REAL*4 and 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 REAL*8 (G_floating) format is stored in binary
excess 1024 notation. The exponent for the REAL*16 format is
stored in binary excess 16384 notation. In REAL*8 (G_floating)
format, binary exponent 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 each floating-point format, fractions are represented in
sign-magnitude notation, with the binary radix point to the left of
the most significant bit. 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*4 (F_floating) numbers occupy four contiguous bytes and the
precision is approximately one part in 2**23, that is, typically 7
decimal digits.
REAL*8 (D_floating) numbers occupy eight contiguous bytes and the
precision is approximately one part in 2**55, that is, typically 16
decimal digits.
REAL*8 (G_floating) numbers occupy eight contiguous bytes 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.
[legal]
[privacy]
[GNU]
[policy]
[netiquette]
[sponsors]
[FAQ]
Polarhome, production since 1999.
Member of Polarhome portal.