Clicky
Showing changes from revision #1 to #2:
(追記) Added (追記ここまで) | (削除) Removed (削除ここまで) | (削除) Chan (削除ここまで)(追記) ged (追記ここまで)
cmplx(x [, y [, kind]])
returns a complex number where x
is converted to the real component. If y
is present it is converted to the imaginary component. If y
is not present then the imaginary component is set to 0.0. If x
is complex then y
must not be present.
(削除) Fortran 77 and later (削除ここまで)(追記) FORTRAN 77 (追記ここまで)(追記) and later (追記ここまで)
(削除) Elemental function (削除ここまで)(追記) Elemental function (追記ここまで)
result = cmplx(x [, y [, kind]])
x
- The type may be integer
, real
, or complex
.y
- (Optional; only allowed if x
is not complex
.) May be integer
or real
.kind
- (Optional) An integer
initialization expression indicating the kind parameter of the result.The return value is of complex
type, with a kind equal to kind
if it is specified. If kind
is not specified, the result is of the default complex
kind, regardless of the kinds of x
and y
.
program test_cmplx
integer :: i = 42
real :: x = 3.14
complex :: z
z = cmplx(i, x)
print *, z, cmplx(x)
end program test_cmplx