Next: CONJG, Previous: COMPILER_VERSION, Up: Intrinsic Procedures [Contents][Index]
9.71 COMPLEX — Complex conversion function
- Description:
COMPLEX(X, Y)returns a complex number where X is converted to the real component and Y is converted to the imaginary component.- Standard:
GNU extension
- Class:
Elemental function
- Syntax:
RESULT = COMPLEX(X, Y)- Arguments:
X The type may be INTEGERorREAL.Y The type may be INTEGERorREAL.- Return value:
If X and Y are both of
INTEGERtype, then the return value is of defaultCOMPLEXtype.If X and Y are of
REALtype, or one is ofREALtype and one is ofINTEGERtype, then the return value is ofCOMPLEXtype with a kind equal to that of theREALargument with the highest precision.- Example:
program test_complex integer :: i = 42 real :: x = 3.14 print *, complex(i, x) end program test_complex- See also:
