Jump to content United States-English
HP.com Home Products and Services Support and Drivers Solutions How to Buy
» Contact HP
More options
HP.com home
HP Fortran 90 Programmer's Reference: HP Series 700/800 Computers > Chapter 3 Data types and data objects

Intrinsic data types

» 

Technical documentation

» Feedback
Content starts here

 » Table of Contents

 » Glossary

 » Index

The numeric types are INTEGER, REAL, and COMPLEX; the nonnumeric types are CHARACTER and LOGICAL.

Each Fortran 90 implementation defines a set of representations for each of these types. Each representation corresponds to a different range of values that can be attained by entities or constants declared to be of the corresponding type.

For real and complex types, different representations also have different levels of precision. Each representation is assigned an identifying kind parameter, which is an integer value. One of the representations for each type is designated the default representation for that type. Table 3-1 “ Types and kind parameters ” shows the options available with HP Fortran 90.

See also the "Data representation models" section of Chapter 11.

Table 3-1  Types and kind parameters

Type

Kind parameter

Range

Bytes

Alignment

INTEGER

1

-128 to 127

1

1

INTEGER

2

-215 to 215-1

2

2

INTEGER

4 (default)

-231 to 231-1

4

4

INTEGER

8

-263 to 263-1

8

8

REAL
Precision:
6 to 9 decimal digits

4 (default)

-3.402823x1038 to 
-1.175495x10-38
and 0.0 and
+1.175495x10-38  to  
+3.402823x1038

4

4

REAL
Precision:
15 to 17 decimal digits

8

-1.797693x10+308 to 
-2.225073x10-308
and 0.0 and 
 +2.225073x10-308 to 
+1.797693x10+308

8

8

REAL
Precision:
33 to 35 decimal digits

16

-1.189731x10+4932 to 
-3.362103x10-4932
and 0.0 and
+3.362103x10-4932 to 
+1.189731x10+4932

16

8

COMPLEX

4 (default)

same as for REAL(4)

8

4

COMPLEX

8

same as for REAL(8)

16

8

CHARACTER

1 (default)

ASCII character set [1]

1

1

LOGICAL

1

.TRUE. .FALSE. [2]

1

1

LOGICAL

2

.TRUE. .FALSE. (2)

2

2

LOGICAL

4 (default)

.TRUE. .FALSE. (2)

4

4

LOGICAL

8

.TRUE. .FALSE. (2)

8

8

[1] The ASCII character set uses only the values 0 to 127, but the HP Fortran 90 implementation allows use of all 8 bits of a CHARACTER entity. The processing of character sets requiring multibyte representation for each character makes use of all 8 bits.

[2] In a standard conforming program, .TRUE. is represented by 1 and .FALSE. is represented by 0.. In nonstandard conforming programs involving arithmetic operators with logical operands, a logical variable may be assigned a value other than 0 or 1. In this case, any nonzero value is considered to be .TRUE. and only the value zero is considered to be .FALSE..

 

The kind parameter for an intrinsic data type is the same as the storage requirements for that data type except for COMPLEX where the kind parameter is the kind parameter of the real or imaginary part.

Following are examples of simple type declarations:

INTEGER :: i,j 
! i and j are default 4-byte integers
INTEGER(KIND=2) :: i2
! i2 is a 2-byte integer
REAL,DIMENSION(5,5) :: a
! a is a 5x5 array of default reals
CHARACTER(LEN=10) :: c10
! c10 is a variable of 10 characters
Printable version
Privacy statement Using this site means you accept its terms Feedback to webmaster
© 1996 Hewlett-Packard Development Company, L.P.