CMPLX(X, Y, KIND)

Purpose

Convert to complex type.

Class

Elemental function

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

Result value

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
Note:
  1. IBM extension.

Related information

DCMPLX(X, Y) (IBM extension), QCMPLX(X, Y) (IBM extension).