diff --git a/base/rational.jl b/base/rational.jl index 8524b35e29467..0b27ce9af4a34 100644 --- a/base/rational.jl +++ b/base/rational.jl @@ -564,13 +564,13 @@ end float(::Type{Rational{T}}) where {T<:Integer} = float(T) -function gcd(x::Rational, y::Rational) +function gcd(x::Rational, y::Rational) if ((isinf(x) && !isinf(y)) || (!isinf(x)) && isinf(y)) throw(ArgumentError("gcd is undefined for one infinite and one finite argument")) end return unsafe_rational(gcd(x.num, y.num), lcm(x.den, y.den)) end -function lcm(x::Rational, y::Rational) +function lcm(x::Rational, y::Rational) if (isinf(x) && !isinf(y)) || (!isinf(x) && isinf(y)) throw(ArgumentError("lcm is undefined for one infinite and one finite argument")) end