COMPLEX — Complex conversion function¶
- COMPLEX(X, Y)¶
COMPLEX(X, Y)returns a complex number whereXis converted to the real component andYis converted to the imaginary component.- Parameters
X – The type may be
INTEGERorREAL.Y – The type may be
INTEGERorREAL.
- Returns
If
XandYare both ofINTEGERtype, then the return value is of defaultCOMPLEXtype.
Standard:GNU extension
Class:Elemental function
Syntax:RESULT = COMPLEX(X, Y)
Example:program test_complex integer :: i = 42 real :: x = 3.14 print *, complex(i, x) end program test_complex
See also:CMPLX