Skip to content

Commit 6644796

Browse files
Add a docstring for Base.divgcd (JuliaLang#53769)
Co-authored-by: Sukera <[email protected]>
1 parent 910bf7e commit 6644796

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

base/rational.jl

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,13 @@ Rational(n::T, d::T) where {T<:Integer} = Rational{T}(n, d)
4949
Rational(n::Integer, d::Integer) = Rational(promote(n, d)...)
5050
Rational(n::Integer) = unsafe_rational(n, one(n))
5151

52+
"""
53+
divgcd(x::Integer, y::Integer)
54+
55+
Returns `(x÷gcd(x,y), y÷gcd(x,y))`.
56+
57+
See also [`div`](@ref), [`gcd`](@ref).
58+
"""
5259
function divgcd(x::TX, y::TY)::Tuple{TX, TY} where {TX<:Integer, TY<:Integer}
5360
g = gcd(uabs(x), uabs(y))
5461
div(x,g), div(y,g)

0 commit comments

Comments
 (0)