We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 738d042 commit 9b397faCopy full SHA for 9b397fa
test/complex.jl
@@ -974,3 +974,16 @@ end
974
" 1.0e-15+2.0im ",
975
" 1.0+2.0e-15im"], "\n")
976
end
977
+
978
+@testset "corner cases of division, issue #22983" begin
979
+ # These results abide by ISO/IEC 10967-3:2006(E) and
980
+ # mathematical definition of division of complex numbers.
981
+ for T in (Float32, Float64, BigFloat)
982
+ @test isequal(one(T) / zero(Complex{T}), one(Complex{T}) / zero(Complex{T}))
983
+ @test isequal(one(T) / zero(Complex{T}), Complex{T}(NaN, NaN))
984
+ @test isequal(one(Complex{T}) / zero(T), Complex{T}(Inf, NaN))
985
+ @test isequal(one(Complex{T}) / one(Complex{T}), one(Complex{T}))
986
+ @test isequal(one(T) / complex(one(T), zero(T)), Complex(one(T), -zero(T)))
987
+ @test isequal(one(T) / complex(one(T), -zero(T)), Complex(one(T), zero(T)))
988
+ end
989
+end
0 commit comments