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.
The default kind can be changed by using the cDEC$ REAL:8 directive or compiler options specifying real size.
REAL(4) and REAL*4 (single precision) are the same data type. REAL(8), REAL*8, and DOUBLE PRECISION are the same data type.
See Also
DOUBLE PRECISION, REAL directive, Real Data Types, General Rules for Real Constants, REAL(4) Constants, REAL(8) or DOUBLE PRECISION Constants, Real and Complex Editing, Model for Real Data
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.)