real

Date:

02-06-2023

NAME

REAL, DREAL, FLOAT, FLOATI, FLOATJ, FLOATK, DFLOAT, DFLOATI, DFLOATJ, DFLOATK, SNGL - Convert types to real

SYNOPSIS

REAL ([A=]a [,[KIND=]kind])
DREAL ([A=]a)
FLOAT ([A=]a)
FLOATI ([A=]a)
FLOATJ ([A=]a)
FLOATK ([A=]a)
DFLOAT ([A=]a)
DFLOATI ([A=]a)
DFLOATJ ([A=]a)
DFLOATK ([A=]a)
SNGL ([A=]a)

STANDARDS

Fortran

Fortran extensions: DREAL, FLOAT, FLOATI, FLOATJ, FLOATK, DFLOAT, DFLOATI, DFLOATJ, DFLOATK

DESCRIPTION

These intrinsic functions convert specified types to type real. They are elemental intrinsic functions that accept the following arguments:

a

For REAL and DREAL, must be type COMPLEX, INTEGER, or REAL.

  • For FLOAT and DFLOAT, must be type INTEGER.

  • For FLOATI and DFLOATI, must be type INTEGER(KIND=2).

  • For FLOATJ and DFLOATJ, must be type INTEGER(KIND=4).

  • For FLOATK and DFLOATK, must be type INTEGER(KIND=8).

  • For SNGL, must be type double-precision real.

  • If a is of type COMPLEX, an approximation of the real part of a is returned.

kind

A scalar integer initialization expression. The kind type to be used for the result. If not specified, the kind type for default REAL is used for INTEGER and REAL arguments. If kind is not present and the argument is COMPLEX, the result has the same kind type as the argument.

Type conversion routines assign the appropriate type to Boolean arguments without shifting or manipulating the bit patterns they represent.

NOTES

The names of these intrinsics cannot be passed as arguments.

RETURN VALUES

If a is of type INTEGER or REAL and kind is specified, the kind type parameter is that specified by kind.

If a is of type INTEGER or REAL and kind is not specified, the kind type parameter is of type default real.

If a is of type COMPLEX and kind is specified, the kind type parameter is that specified by kind.

If a if of type COMPLEX and kind is not specified, the kind type parameter is the kind type parameter of a.

REAL returns default REAL.

DREAL, DFLOAT, DFLOATI, DFLOATJ, and DFLOATK return double-precision real.

FLOAT, FLOATI, FLOATJ, FLOATK and SNGL return single-precision real.