diff --git a/base/rational.jl b/base/rational.jl index 3736173cc3626..6b54a409588d2 100644 --- a/base/rational.jl +++ b/base/rational.jl @@ -403,18 +403,6 @@ function *(y::Integer, x::Rational) end /(x::Rational, y::Union{Rational, Integer}) = x//y /(x::Integer, y::Rational) = x//y -# Avoid overflow for Rational math if result is zero. -# This method is needed because previously this method didn't check for overflows -# but would return the correct answer if `a` was zero even if 1//z was wrong. -function /(a::Rational, z::Complex{<:Integer}) - z_r = complex(Rational(real(z)), Rational(imag(z))) - if iszero(a) && !iszero(z) - a/oneunit(z_r) - else - a/z_r - end -end - inv(x::Rational) = checked_den(x.den, x.num) fma(x::Rational, y::Rational, z::Rational) = x*y+z diff --git a/test/rational.jl b/test/rational.jl index 59d21aede7fd6..e310875a52a83 100644 --- a/test/rational.jl +++ b/test/rational.jl @@ -203,7 +203,6 @@ end end @test Rational(rand_int, 3)/Complex(3, 2) == Complex(Rational(rand_int, 13), -Rational(rand_int*2, 39)) - @test iszero(zero(Rational{Int8}) / complex(Int8(100), Int8(100))) @test (true//true) / complex(false, true) === 0//1 - 1//1*im @test (false//true) / complex(false, true) === 0//1 + 0//1*im @test (false//true) / complex(true, false) === 0//1 + 0//1*im