-
-
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
Inconsistency in max(-Inf,NaN) #10729
Comments
On 0.3 we have julia> min(-Inf,NaN), min(Inf,NaN), max(-Inf,NaN), max(Inf,NaN)
(-Inf,Inf,-Inf,Inf) but on 0.4 we currently have julia> min(-Inf,NaN), min(Inf,NaN), max(-Inf,NaN), max(Inf,NaN)
(-Inf,Inf,NaN,Inf) Aside from the fact that this turns out to break Winston, this seems inconsistent. Last touched in #9416 (7d2e697), CC @lbenet. No matter how this gets fixed, we should add a test for this behavior. |
We should also test both orders of the arguments, since the implementation is not symmetric in its arguments. |
related - #7866 |
Solves the inconsistency #10729 and add tests
closed by #10736 |
This still seems wrong. It seems like |
If you argue that LLVM recently had a very long discussion about what "undefined" means. The upshot is that there are two different meanings: "I don't know what value" and "there is no possible value", corresponding to the types Given that |
Unfortunately IEEE 754-2008 is not consistent about In particular, the standard defines julia> min(-Inf,NaN), min(Inf,NaN), max(-Inf,NaN), max(Inf,NaN)
(-Inf,Inf,-Inf,Inf) |
I'm also reminded that this exact discussion was brought up in #7866, and in particular @ArchRobison got a response from William Kahan himself in #7866 (comment) suggesting that |
@stevengj I don't understand why One more thing: there is julia> minmax(NaN,-NaN) === (-NaN,-NaN)
true
julia> minmax(-NaN,NaN) === (NaN,NaN)
true |
@stevengj Thanks, I now understand the reason for the expected results. Yet, currently, there are functions with the property pointed out by Kahan which do not yield Once said this, I agree for poisoning I think it is important to preserve commutativity, and probably also introduce EDIT: Corrected the link to point to the comment. |
No description provided.
The text was updated successfully, but these errors were encountered: