Skip to content

Commit

Permalink
Minor docs correction for maxintfloat. (#29301)
Browse files Browse the repository at this point in the history
Fixes #29297, see discussion there.
  • Loading branch information
tpapp authored and JeffBezanson committed Sep 24, 2018
1 parent 8484f97 commit 64a4f18
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions base/floatfuncs.jl
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,13 @@ signbit(x::Float16) = signbit(bitcast(Int16, x))
"""
maxintfloat(T=Float64)
The largest consecutive integer that is exactly represented in the given floating-point type `T`
(which defaults to `Float64`).
The largest consecutive integer-valued floating-point number that is exactly represented in
the given floating-point type `T` (which defaults to `Float64`).
That is, `maxintfloat` returns the smallest positive integer `n` such that `n+1`
is *not* exactly representable in the type `T`.
That is, `maxintfloat` returns the smallest positive integer-valued floating-point number
`n` such that `n+1` is *not* exactly representable in the type `T`.
When an `Integer`-type value is needed, use `Integer(maxintfloat(T))`.
"""
maxintfloat(::Type{Float64}) = 9007199254740992.
maxintfloat(::Type{Float32}) = Float32(16777216.)
Expand Down

0 comments on commit 64a4f18

Please sign in to comment.