-
Notifications
You must be signed in to change notification settings - Fork 71
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
Normalise negative zero to zero #473
Comments
Section 12.12.8 Numeric functions of intervals
so if I understand correctly we should map 0 to +0.0 except for |
but the only cases I can think of in practice when this would matter are
|
A (naive) possible implementation (for printing): julia> myprint(x) = !iszero(x) ? x : zero(x)
myprint (generic function with 1 method)
julia> myprint(0.0)
0.0
julia> myprint(-0.0)
0.0 |
The ITL test suite has indeed
so maybe we should define
I don't recall the details of printing, but if This also strengthens my idea that we should use at this point the fact that |
WoW this opened Pandora's box! I generated the tests in ITF1788.jl using === and now there are many more tests failing because of that, e.g.
expected value and
expected value one alternative could be to use |
I think we should rather check for 0 during interval construction, I feel like |
Adding this check to I think fixing that would require that the check for zero is performed also by internal constructors (which maybe is what you meant from the beginning, apologies if I missed it) On the other side, I think we don't want internal constructors to perform validity checks, so maybe we should have Ideally, I think rounding functionalities should take care of mapping 0 to -0.0 with |
We should definitely normalise -0.0 to 0.0.
The text was updated successfully, but these errors were encountered: