Skip to content

Commit

Permalink
Small tweaks to docstrings
Browse files Browse the repository at this point in the history
  • Loading branch information
Keno committed Aug 25, 2019
1 parent a71f150 commit 763db7f
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions base/div.jl
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ div(x, y, r::RoundingMode)
div(a, b) = div(a, b, RoundToZero)

"""
rem(x, y, r::RoundingMode)
rem(x, y, r::RoundingMode=RoundToZero)
Compute the remainder of `x` after integer division by `y`, with the quotient rounded
according to the rounding mode `r`. In other words, the quantity
Expand Down Expand Up @@ -98,10 +98,11 @@ cld(a, b) = div(a, b, RoundUp)

# divrem
"""
divrem(x, y)
divrem(x, y, r::RoundingMode=RoundToZero)
The quotient and remainder from Euclidean division. Equivalent to `(div(x,y), rem(x,y))` or
`(x÷y, x%y)`.
The quotient and remainder from Euclidean division.
Equivalent to `(div(x,y,r), rem(x,y,r))`. Equivalently, with the the default
value of `r`, this call is equivalent to `(x÷y, x%y)`.
# Examples
```jldoctest
Expand All @@ -113,6 +114,7 @@ julia> divrem(7,3)
```
"""
divrem(x, y) = divrem(x, y, RoundToZero)
divrem(a, b, r::RoundingMode) = (div(a, b, r), rem(a, b, r))
function divrem(x::Integer, y::Integer, rnd::typeof(RoundNearest))
(q, r) = divrem(x, y)
if x >= 0
Expand Down Expand Up @@ -162,9 +164,6 @@ function divrem(x::Integer, y::Integer, rnd::typeof(RoundNearestTiesUp))
end
end


divrem(a, b, r::RoundingMode) = (div(a, b, r), rem(a, b, r))

"""
fldmod(x, y)
Expand Down

0 comments on commit 763db7f

Please sign in to comment.