インテル® Fortran コンパイラー 19.0 デベロッパー・ガイドおよびリファレンス

Real Data Types

Real data types can be specified as follows:

REAL

REAL([KIND=]n)

REAL*n

DOUBLE PRECISION

n

Is a constant expression that evaluates to kind 4, 8, or 16.

If a kind parameter is specified, the real constant has the kind specified. If a kind parameter is not specified, the kind is default real.

Default real is affected by compiler options specifying real size and by the REAL directive.

The default KIND for DOUBLE PRECISION is affected by compiler option double-size. If this compiler option is not specified, default DOUBLE PRECISION is REAL(8).

No kind parameter is permitted for data declared with type DOUBLE PRECISION.

The intrinsic inquiry function KIND returns the kind type parameter. The intrinsic inquiry function RANGE returns the decimal exponent range, and the intrinsic function PRECISION returns the decimal precision. You can use the intrinsic function SELECTED_REAL_KIND to find the kind values that provide a given precision and exponent range.

Examples

The following examples show how real variables can be declared.

An entity-oriented example is:

 REAL (KIND = high), OPTIONAL :: testval
 REAL, SAVE :: a(10), b(20,30)

An attribute-oriented example is:

 REAL (KIND = high) testval
 REAL a(10), b(20,30)
 OPTIONAL testval
 SAVE a, b

See Also