Next: RRSPACING, Previous: RANGE, Up: Intrinsic Procedures
REAL
— Convert to real typeREAL(X [, KIND])
converts its argument X to a real type. The
REALPART(X)
function is provided for compatibility with g77,
and its use is strongly discouraged.
X = REAL(X)
|
X = REAL(X, KIND)
|
X = REALPART(Z)
|
X | shall be INTEGER(*) , REAL(*) , or
COMPLEX(*) .
|
KIND | (Optional) KIND shall be a scalar integer.
|
REAL(*)
variable or array under
the following rules:
REAL(X)
is converted to a default real type if X is an
integer or real variable.
REAL(X)
is converted to a real type with the kind type parameter
of X if X is a complex variable.
REAL(X, KIND)
is converted to a real type with kind type
parameter KIND if X is a complex, integer, or real
variable.
program test_real complex :: x = (1.0, 2.0) print *, real(x), real(x,8), realpart(x) end program test_real