Skip to content

Commit

Permalink
Add docstrings that RoundFromZero requires Julia 1.8
Browse files Browse the repository at this point in the history
  • Loading branch information
jessymilare committed Sep 12, 2021
1 parent 57cc756 commit 687f4c1
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
6 changes: 6 additions & 0 deletions base/div.jl
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ without any intermediate rounding.
See also [`fld`](@ref) and [`cld`](@ref), which are special cases of this function.
!!! compat "Julia 1.8"
`RoundFromZero` requires at least Julia 1.8.
# Examples:
```jldoctest
julia> div(4, 3, RoundDown) # Matches fld(4, 3)
Expand Down Expand Up @@ -68,6 +71,9 @@ without any intermediate rounding.
`[0, -y)` otherwise. The result may not be exact if `x` and `y` have the same sign, and
`abs(x) < abs(y)`. See also [`RoundFromZero`](@ref).
!!! compat "Julia 1.8"
`RoundFromZero` requires at least Julia 1.8.
# Examples:
```jldoctest
julia> x = 9; y = 4;
Expand Down
10 changes: 9 additions & 1 deletion base/rounding.jl
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,10 @@ Currently supported rounding modes are:
- [`RoundFromZero`](@ref)
- [`RoundUp`](@ref)
- [`RoundDown`](@ref)
!!! compat "Julia 1.8"
`RoundFromZero` requires at least Julia 1.8. Prior versions support
`RoundFromZero` for `BigFloat`s only.
"""
struct RoundingMode{T} end

Expand Down Expand Up @@ -77,13 +81,17 @@ const RoundDown = RoundingMode{:Down}()
Rounds away from zero.
!!! compat "Julia 1.8"
`RoundFromZero` requires at least Julia 1.8. Prior versions support
`RoundFromZero` for `BigFloat`s only.
# Examples
```jldoctest
julia> BigFloat("1.0000000000000001", 5, RoundFromZero)
1.06
```
"""
const RoundFromZero = RoundingMode{:FromZero}() # mpfr only
const RoundFromZero = RoundingMode{:FromZero}()

"""
RoundNearestTiesAway
Expand Down

0 comments on commit 687f4c1

Please sign in to comment.