Intel® Fortran Compiler Classic and Intel® Fortran Compiler Developer Guide and Reference

ID 767251
Date 11/07/2023
Public

A newer version of this document is available. Customers should click here to go to the newest version.

Document Table of Contents

REAL Statement

Statement: Specifies the REAL data type.

REAL

REAL([KIND=] n)

REAL* n

DOUBLE PRECISION

n

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

Description

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.

REAL(4) and REAL*4 (single precision) are the same data type. REAL(8), REAL*8, and DOUBLE PRECISION are the same data type.

Example

! type declarations with attribute specifiers
REAL (8), PARAMETER :: testval=50.d0
REAL, SAVE :: a(10), b(20,30)
REAL, PARAMETER :: x = 100.

! attribute statements to declare the same entities
REAL x, a, b, testval*8
DIMENSION a(10), b(20,30)
SAVE a, b
PARAMETER (x = 100., testval=50.d0)