REAL

Statement: Specifies the REAL data type.

Syntax

REAL
REAL([KIND=]n)
REAL*n
DOUBLE PRECISION

n
Is kind 4 or 8.

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.

DOUBLE PRECISION is REAL(8). No kind parameter is permitted for data declared with type DOUBLE PRECISION.

To change the default kind value, use the /real_size compiler option or the cDEC$ REAL:8 directive.

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

Compatibility

CONSOLE STANDARD GRAPHICS QUICKWIN GRAPHICS WINDOWS DLL LIB

See Also: DOUBLE PRECISION, REAL directive, Real Data Types, General Rules for Real Constants, REAL(4) Constants, REAL(8) or DOUBLE PRECISION Constants

Examples

Entity-oriented examples are:

 MODULE DATDECLARE
    REAL (8), OPTIONAL :: testval=50.d0
    REAL, SAVE :: a(10), b(20,30)
    REAL, PARAMETER :: x = 100.

 Attribute-oriented examples are:
 MODULE DATDECLARE
    REAL (8) testval=50.d0
    REAL x, a(10), b(20,30)
    OPTIONAL testval
    SAVE a, b
    PARAMETER (x = 100.)