Next: RENAME, Previous: RAN, 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.
RESULT = REAL(X [, KIND])
|
RESULT = REALPART(Z)
|
| X | Shall be INTEGER(*), REAL(*), or
COMPLEX(*).
|
| KIND | (Optional) An INTEGER(*) initialization
expression indicating the kind parameter of
the result.
|
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