-
-
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
Correct exponent_max to conform to IEEE754-2008 #24978
Conversation
Do we need this? What's wrong with |
See also #24631 |
I would be in favour of renaming |
Julia has been assigning exponent_max values that do not conform to IEEE754-2008,
# These are the tabulated values (see Table 3.2 on page 8 of the IEEE Standard).
exponent_max(::Type{Float16}) = 15
exponent_max(::Type{Float32}) = 127
exponent_max(::Type{Float64}) = 1023 All the details are here: https://github.com/JeffreySarnoff/IEEE754-2008.md. |
|
As I understand the writing, Emax is one of their essential quantities. Since Emin is, by design, 1-Emax always, and that almost evenly biased exponents are used, Emax is another way of writing exponent_bias (bias). The fact that |
Ping |
It seems there are no problems with this (I dunno what Xcode failure is). |
the freebsd link is to nowhere |
A helpful fairy fixed the tests. |
super -- I await the merge! |
This is still good to go. |
^ (any reason not to merge this)? |
I'm in favour of this. Since it is a change, should probably be documented in NEWS.md |
Yes. BTW pkg.julialang.com shows no use, only @JeffreySarnoff providing the functionality independently in https://github.com/JeffreySarnoff/LowLevelFloatFunctions.jl |
What is the right header for the NEW item?
|
Ah, if it's not exported it probably doesn't need an item. |
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.
Would be good to link to exponent
help.
Co-Authored-By: Simon Byrne <[email protected]>
Something with the CI is failing currently, I think unrelatedly to this change. I'll leave it and maybe someone with rights can trigger the tests when things run smoothly again. |
Ping |
Needs a rebase |
I am out, honestly |
@admin fyi^ |
@mschauer Sorry I didn't understand this comment? Do you mean you are no longer interested in rebasing this? Thanks. |
That was my interpretation of the comment and frankly it's pretty understandable given that it's been three years. |
I concur. Would an appropriate admin rebase this, please. |
I'll try to get around to rebasing this soon. Thanks for the effort @mschauer |
exponent_max
was not giving the maximum exponent, but a sentinel value forInf
andNaN
which is not a legal exponent. I found this error prone. Exponent exponent_max returns actual maximum exponent. As a by-product the code become somewhat more readable. ("if k is one bigger than the maximum exponent, first multiply y with 2 and then with the highest power of two representable...") I added internal docstrings to help the future readers.