-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Minor docs correction for maxintfloat. #29301
Conversation
Fixes JuliaLang#29297, see discussion there.
base/floatfuncs.jl
Outdated
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 is needed, use `Integer(maxintfloat(T))`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When an integer type is needed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am not sure I understand, as Integer(maxintfloat(T))
will return an integer (value), not a type.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
“Integer-typed value”?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The point is that maxintfloat(T)
returns an integer already (1.0
is an integer), so your current wording is misleading.
"When an Integer
-type value is needed" seems okay.
base/floatfuncs.jl
Outdated
@@ -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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"floating-point number" should be hyphenated (compound adjective)
Fixes #29297, see discussion there.