We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 95072cd commit 3fc38ccCopy full SHA for 3fc38cc
base/complex.jl
@@ -92,7 +92,8 @@ isreal(z::Complex) = iszero(imag(z))
92
93
Test whether `z` is purely imaginary, i.e. has a real part equal to 0.
94
"""
95
-isimag(z::Number) = iszero(real(z))
+isimag(z::Real) = false
96
+isimag(z::Complex) = iszero(real(z))
97
isinteger(z::Complex) = isreal(z) & isinteger(real(z))
98
isfinite(z::Complex) = isfinite(real(z)) & isfinite(imag(z))
99
isnan(z::Complex) = isnan(real(z)) | isnan(imag(z))
test/complex.jl
@@ -969,3 +969,6 @@ end
969
970
# issue #19240
971
@test big(1)/(10+10im) ≈ (5-5im)/big(100) ≈ big"0.05" - big"0.05"*im
972
+
973
+# Test that isimag yields false for real numbers that are zero
974
+@test !isimag(0)
0 commit comments