aimag(z)
yields the imaginary part of complex argument z
. The imag(z)
and imagpart(z)
intrinsic functions are provided for compatibility with g77
, and their use in new code is strongly discouraged.
FORTRAN 77 and later
Elemental function
result = aimag(z)
z
- The type of the argument shall be complex
.The return value is of type real
with the kind type parameter of the argument.
program test_aimag
complex(4) z4
complex(8) z8
z4 = cmplx(1.e0_4, 0.e0_4)
z8 = cmplx(0.e0_8, 1.e0_8)
print *, aimag(z4), dimag(z8)
end program test_aimag