Skip to content

Commit

Permalink
Update rational.jl
Browse files Browse the repository at this point in the history
whitespace
  • Loading branch information
Priynsh authored Jan 16, 2025
1 parent cb5b47f commit 5389055
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions base/rational.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 5389055

Please sign in to comment.