Skip to content

Commit

Permalink
minor: short form function for inv
Browse files Browse the repository at this point in the history
Co-authored-by: Mustafa M <[email protected]>
  • Loading branch information
Liozou and musm committed May 1, 2020
1 parent 3f6ffa0 commit 40dc56d
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions base/rational.jl
Original file line number Diff line number Diff line change
Expand Up @@ -319,9 +319,7 @@ function *(y::Integer, x::Rational)
end
/(x::Rational, y::Union{Rational, Integer, Complex{<:Union{Integer,Rational}}}) = x//y
/(x::Union{Integer, Complex{<:Union{Integer,Rational}}}, y::Rational) = x//y
function inv(x::Rational{T}) where T
checked_den(x.den, x.num)
end
inv(x::Rational{T}) where {T} = checked_den(x.den, x.num)

fma(x::Rational, y::Rational, z::Rational) = x*y+z

Expand Down

0 comments on commit 40dc56d

Please sign in to comment.