DCMPLX — Double complex conversion function¶
- DCMPLX(X[, Y])¶
DCMPLX(X [,Y])returns a double complex number whereXis converted to the real component. IfYis present it is converted to the imaginary component. IfYis not present then the imaginary component is set to 0.0. IfXis complex thenYmust not be present.- Parameters
X – The type may be
INTEGER,REAL, orCOMPLEX.Y – (Optional if
Xis notCOMPLEX.) May beINTEGERorREAL.
- Returns
The return value is of type
COMPLEX(8)
Standard:GNU extension
Class:Elemental function
Syntax:RESULT = DCMPLX(X [, Y])
Example:program test_dcmplx integer :: i = 42 real :: x = 3.14 complex :: z z = cmplx(i, x) print *, dcmplx(i) print *, dcmplx(x) print *, dcmplx(z) print *, dcmplx(x,i) end program test_dcmplx