HP OpenVMS Systems Documentation 
HP Fortran for OpenVMS

Previous  Contents  Index 
This chapter describes:
Table 81 lists the intrinsic data types provided by HP Fortran, the storage required, and valid numeric ranges.
Data Type  Bytes  Description 

BYTE (INTEGER*1)  1 (8 bits)  A BYTE declaration is a signed integer data type equivalent to INTEGER*1 or INTEGER (KIND=1). 
INTEGER  1, 2, 4, or 8  Signed integer whose size is controlled by a kind type parameter or, if a kind type parameter (or size specifier) is omitted, certain FORTRAN command qualifiers (see Section 8.2.1). 
INTEGER (KIND=1)
INTEGER*1 
1 (8 bits)  Signed integer value from 128 to 127 (2**7 to 2**71). Unsigned values from 0 to 255 (2**81) 
INTEGER (KIND=2)
INTEGER*2 
2 (16 bits)  Signed integer value from 32,768 to 32,767 (2**15 to 2**151). Unsigned values from 0 to 65535 (2**161) ^{1}. 
INTEGER (KIND=4)
INTEGER*4 
4 (32 bits)  Signed integer value from 2,147,483,648 to 2,147,483,647 (2**31 to 2**311). Unsigned values from 0 to 4,294,967,295 (2**321) ^{1}. 
INTEGER (KIND=8)
INTEGER*8 
8 (64 bits)  Signed integer value from 9,223,372,036,854,775,808 to 9,223,372,036,854,775,807 (2**63 to 2**631). 
LOGICAL  1, 2, 4, or 8  Logical value whose size is controlled by a kind type parameter or, if a kind type parameter (or size specifier) is omitted, certain FORTRAN command qualifiers (see Section 8.3). 
LOGICAL (KIND=1)
LOGICAL*1 
1 (8 bits)  Logical values .TRUE. or .FALSE. 
LOGICAL (KIND=2)
LOGICAL*2 
2 (16 bits)  Logical values .TRUE. or .FALSE. ^{2} 
LOGICAL (KIND=4)
LOGICAL*4 
4 (32 bits)  Logical values .TRUE. or .FALSE. ^{2} 
LOGICAL (KIND=8)
LOGICAL*8 
8 (64 bits)  Logical values .TRUE. or .FALSE. ^{2} 
REAL  4 or 8  Real floatingpoint numbers whose size is controlled by a kind type parameter or, if a kind type parameter (or size specifier) is omitted, by using the FORTRAN command /REAL_SIZE qualifier. To control the floatingpoint format used in memory, use the FORTRAN command /FLOAT qualifier. 
REAL (KIND=4)
REAL*4 
4 (32 bits) 
Singleprecision real
floatingpoint values in IEEE S_float or VAX F_float formats.
IEEE S_float normalized values range from 1.17549435E38 to 3.40282347E38. Values between 1.17549429E38 and 1.40129846E45 are denormalized ^{3}. VAX F_float values range from 0.293873588E38 to 1.7014117E38. 
DOUBLE PRECISION
REAL (KIND=8) REAL*8 
8 (64 bits) 
Doubleprecision real
floatingpoint values in IEEE T_float, VAX G_float, or VAX D_float
formats.
IEEE T_float normalized values range from 2.2250738585072013D308 to 1.7976931348623158D308. Values between 2.2250738585072008D308 and 4.94065645841246544D324 are denormalized ^{3}. VAX G_float values range from 0.5562684646268004D308 to 0.89884656743115785407D308. VAX D_float values range from 0.2938735877055719D38 to 1.70141183460469229D38. You can change the data size of DOUBLE PRECISION declarations from REAL (KIND=8) to REAL (KIND=16) with the FORTRAN command /DOUBLE_SIZE qualifier. 
REAL (KIND=16)
REAL*16 
16 (128 bits)  Extendedprecision real floatingpoint values in IEEElike X_float format ranging from 6.4751751194380251109244389582276465524996Q4966 to 1.189731495357231765085759326628007016196477Q4932. The smallest normalized number is 3.362103143112093506262677817321753Q4932. 
COMPLEX  8, 16, or 32  Complex floatingpoint numbers whose size is controlled by a kind type parameter or, if a kind type parameter (or size specifier) is omitted, the FORTRAN command /REAL_SIZE qualifier. To control the floatingpoint format used in memory, use the FORTRAN command /FLOAT qualifier. 
COMPLEX (KIND=4)
COMPLEX*8 
8 (64 bits) 
Singleprecision complex floatingpoint values in a pair of
floatingpoint parts: real and imaginary. Use the IEEE S_float or VAX
F_float format.
IEEE S_float real and imaginary parts range from 1.17549435E38 to 3.40282347E38. Values between 1.17549429E38 and 1.40129846E45 are denormalized ^{3}. VAX F_float real and imaginary parts range from 0.293873588E38 to 1.7014117E38. 
DOUBLE COMPLEX
COMPLEX (KIND=8) COMPLEX*16 
16 (128 bits) 
Doubleprecision complex floatingpoint values in a pair of parts: real
and imaginary. Use the IEEE T_float, VAX G_float, or VAX D_float format.
IEEE T_float format real and imaginary parts each range from 2.2250738585072013D308 to 1.7976931348623158D308. Values between 2.2250738585072008D308 and 4.94065645841246544D324 are denormalized ^{3}. VAX G_float format real and imaginary parts each range from 0.5562684646268004D308 to 0.89884656743115785407D308. VAX D_float format real and imaginary parts each range from 0.2938735877055719D38 to 1.70141183460469229D38. 
COMPLEX (KIND=16)
COMPLEX*32 
32 (256 bits)  Extendedprecision complex floatingpoint values in a pair of IEEE X_float format parts: real and imaginary. The real and imaginary parts each range from 6.4751751194380251109244389582276465524996Q4966 to 1.189731495357231765085759326628007016196477Q4932. 
CHARACTER  1 byte (8 bits) per character  Character data represented by character code convention. Character declarations can be in the form CHARACTER(LEN= n), CHARACTER( n), or CHARACTER* n, where n is the number of bytes or n can be (*) to indicate passedlength format. 
HOLLERITH  1 byte (8 bits) per Hollerith character  Hollerith constants. 
In addition to the intrinsic numeric data types, you can define nondecimal (binary, octal, or hexadecimal) constants as explained in the HP Fortran for OpenVMS Language Reference Manual.
Integer data lengths can be one, two, four, or eight bytes in length.
Integer data is signed with the sign bit being 0 (zero) for positive numbers and 1 for negative numbers.
To improve performance, avoid using 2byte or 1byte integer declarations (see Chapter 5).
The default size used for an INTEGER data declaration without a kind parameter (or size specifier) is INTEGER (KIND=4) (same as INTEGER*4), unless you do one of the following:
Intrinsic INTEGER (KIND=1) or INTEGER*1 signed values range from 128 to 127 and are stored in a two's complement representation. For example:
+22 = 16(hex) 7 = F9(hex) 
INTEGER (KIND=1) or INTEGER*1 values are stored in one byte, as shown in Figure 81.
Figure 81 INTEGER (KIND =1) or INTEGER*1 Representation
Intrinsic INTEGER (KIND=2) or INTEGER*2 signed values range from 32,768 to 32,767 and are stored in a two's complement representation. For example:
+22 = 0016(hex) 7 = FFF9(hex) 
INTEGER (KIND=2) or INTEGER*2 values are stored in two contiguous bytes, as shown in Figure 82.
Figure 82 INTEGER (KIND =2) or INTEGER*2 Representation
Intrinsic INTEGER (KIND=4) or INTEGER*4 signed values range from 2,147,483,648 to 2,147,483,647 and are stored in a two's complement representation. INTEGER (KIND=4) or INTEGER*4 values are stored in four contiguous bytes, as shown in Figure 83.
Figure 83 INTEGER (KIND =4) or INTEGER*4 Representation
Intrinsic INTEGER (KIND=8) or INTEGER*8 signed values range from 9,223,372,036,854,775,808 to 9,223,372,036,854,775,807 and are stored in a two's complement representation. INTEGER*8 or INTEGER (KIND=8) values are stored in eight contiguous bytes, as shown in Figure 84.
Figure 84 INTEGER (KIND =8) or INTEGER*8 Representation
Logical data can be one, two, four, or eight bytes in length.
The default size used for a LOGICAL data declaration without a kind parameter (or size specifier) is LOGICAL (KIND=4) (same as LOGICAL*4), unless you do one of the following:
To improve performance, avoid using 2byte or 1byte logical declarations (see Chapter 5).
Intrinsic LOGICAL*1 or LOGICAL (KIND=1) values are stored in a single byte.
Logical (intrinsic) values can also be stored in the following sizes of contiguous bytes starting on an arbitrary byte boundary:
The loworder bit determines whether the logical value is true or false. Logical variables can also be interpreted as integer data (an extension to the Fortran 90 standard). For example, in addition to having logical values .TRUE. and .FALSE., LOGICAL*1 data can also have values in the range 128 to 127.
LOGICAL*1, LOGICAL*2, LOGICAL*4, and LOGICAL*8 data representations appear in Figure 85.
Figure 85 LOGICAL Representations
Floatingpoint numbers are stored on OpenVMS systems in one of the following IEEE or VAX little endian binary floatingpoint formats, as follows:
COMPLEX numbers use a pair of little endian REAL values to denote the real and imaginary parts of the data, as follows:
To specify the floatingpoint format used in memory, use the FORTRAN command /FLOAT qualifier. If you do not specify the /FLOAT qualifier, the following formats are used:
To change the default size for REAL and COMPLEX declarations, use the FORTRAN command /REAL_SIZE qualifier.
To change the default size for DOUBLE PRECISION declarations, use the FORTRAN command /DOUBLE_SIZE qualifier.
All floatingpoint formats represent fractions using signmagnitude 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 for S_floating and T_floating. Fractions are assumed to be normalized, and therefore the most significant bit is not stored. This is called "hidden bit normalization".
With IEEE data, the hidden bit is assumed to be 1 unless the exponent is 0. If the exponent equals 0, then the value represented is denormalized (subnormal) or plus or minus 0 (zero).
With VAX data, the hidden bit is assumed to be 1.
For an explanation of the representation of NaN, Infinity, and related IEEE exceptional values, see Section 8.4.8.
The default size for REAL, COMPLEX, and DOUBLE PRECISION data declarations are as follows:
You can explicitly declare the length of a REAL or a COMPLEX declaration using a kind parameter or specify DOUBLE PRECISION or DOUBLE COMPLEX.
Intrinsic REAL kinds are 4 (single precision) and 8 (double precision); intrinsic COMPLEX kinds are also 4 (single precision) and 8 (double precision). For example, REAL (KIND=4) requests singleprecision floatingpoint data.
You can also use a size specifier, such as REAL*4, but be aware this is an extension to the Fortran 90 standard.
REAL (KIND=4) or REAL*4 data can be in IEEE S_float or VAX F_float formats. This is the default data size for REAL declarations.
Intrinsic REAL (KIND=4) or REAL*4 (single precision REAL) data occupies four contiguous bytes stored in IEEE S_float format. Bits are labeled from the right, 0 through 31, as shown in Figure 86.
Figure 86 IEEE S_float REAL (KIND =4) or REAL*4 Representation
The form of REAL (KIND=4) or REAL*4 data is sign magnitude, with:
The value of data is in the approximate range: 1.17549435E38 (normalized) to 3.40282347E38. The IEEE denormalized limit is 1.40129846E45.
The precision is approximately one part in 2**23, typically seven decimal digits.
Intrinsic REAL (KIND=4) or REAL*4 F_float data occupies four contiguous bytes. Bits are labeled from the right, 0 through 31, as shown in Figure 87.
Figure 87 VAX F_float REAL (KIND =4) or REAL*4 Representation
The form of REAL (KIND=4) or REAL*4 F_float data is sign magnitude, where:
The value of data is in the approximate range: 0.293873588E38 to 1.7014117E38.
The precision is approximately one part in 2**23, typically seven decimal digits.
REAL (KIND=8) or REAL*8 data can be in IEEE T_float, VAX G_float, or VAX D_float formats.
Intrinsic REAL (KIND=8) or REAL*8 (same as DOUBLE PRECISION) data occupies eight contiguous bytes stored in IEEE T_float format. Bits are labeled from the right, 0 through 63, as shown in Figure 88.
Figure 88 IEEE T_float REAL (KIND =8) or REAL*8 Representation
The form of REAL (KIND=8) or REAL*8 data is sign magnitude, with:
The value of data is in the approximate range: 2.2250738585072013D308 (normalized) to 1.7976931348623158D308. The IEEE denormalized limit is 4.94065645841246544D324.
The precision is approximately one part in 2**52, typically 15 decimal digits.
Previous  Next  Contents  Index 