REAL(A, KIND)

Purpose

Convert to real type.

Class

Elemental function

Argument type and attributes

A
An INTENT(IN) INTEGER, REAL, COMPLEX or boz-literal CONSTANT
KIND (optional)
An INTENT(IN) INTEGER scalar. The actual argument corresponding to KIND must be a constant expression.

Result type and attributes

Result value

Examples

REAL (-3) has the value -3.0. REAL ((3.2, 2.1)) has the value 3.2.

Specific Name Argument Type Result Type Pass As Arg?
REAL default integer default real no
FLOAT any integer  1  default real no
SNGL double precision real default real no
SNGLQ REAL(16) default real no  2 
DREAL double complex double precision real no  2 
QREAL COMPLEX(16) REAL(16) no  2 
Note:
  •  1  IBM extension: the ability to specify a nondefault integer argument.
  •  2  IBM extension: the inability to pass the name as an argument.

Fortran 2008 beginsIn Fortran 2008, you can use designator%RE to access the real part of complex numbers directly; for instance, A%RE has the same value as REAL(A). For more information about complex part designators, see Complex.Fortran 2008 ends