Skip to content
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

Merged
merged 2 commits into from
Sep 24, 2018

Conversation

tpapp
Copy link
Contributor

@tpapp tpapp commented Sep 21, 2018

Fixes #29297, see discussion there.

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))`.
Copy link
Member

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

Copy link
Contributor Author

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.

Copy link
Sponsor Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

“Integer-typed value”?

Copy link
Member

@stevengj stevengj Sep 21, 2018

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.

@@ -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
Copy link
Member

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)

@JeffBezanson JeffBezanson merged commit 64a4f18 into JuliaLang:master Sep 24, 2018
@KristofferC KristofferC added domain:docs This change adds or pertains to documentation backport pending 1.0 labels Sep 30, 2018
KristofferC pushed a commit that referenced this pull request Sep 30, 2018
Fixes #29297, see discussion there.

(cherry picked from commit 64a4f18)
KristofferC pushed a commit that referenced this pull request Feb 11, 2019
Fixes #29297, see discussion there.

(cherry picked from commit 64a4f18)
KristofferC pushed a commit that referenced this pull request Feb 20, 2020
Fixes #29297, see discussion there.

(cherry picked from commit 64a4f18)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
domain:docs This change adds or pertains to documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants