Purpose
Convert to complex type.
Argument type and attributes
- X
- An INTENT(IN) INTEGER, REAL, COMPLEX, BINARY, OCTAL,
or hexadecimal CONSTANT.
- Y (optional)
- An INTENT(IN) INTEGER, REAL, COMPLEX, BINARY, OCTAL,
or hexadecimal CONSTANT. It must not be present if
X is a COMPLEX.
- KIND (optional)
- An INTENT(IN) scalar INTEGER.
The actual argument corresponding to KIND must
be a constant expression.
Result type and attributes
- It is of type complex.
- If KIND is present, the kind type parameter
is that specified by KIND; otherwise, the
kind type parameter is that of the default real type.
Result value
- If Y is absent and X is not complex, it is as if Y were present
with the value zero.
- If Y is absent and X is complex, it is as if Y were present with
the value AIMAG(X).
- CMPLX(X, Y, KIND) has the complex value whose real part is REAL(X,
KIND) and whose imaginary part is REAL(Y, KIND).
Examples
CMPLX (-3)
has the value (-3.0, 0.0).
Specific Name |
Argument Type |
Result Type |
Pass As Arg? |
CMPLX 1 |
default real |
default complex |
no |