Skip to content

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
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.

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 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

docs This change adds or pertains to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants