-
-
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
Missing round methods for RoundNearest #15115
Comments
Yes, it should. Unfortunately, LLVM doesn't support it, though hopefully they should in future as |
Oh, so it functionally can't be done, and |
|
If I understand correctly, it is impossible to have a RoundNearest rounding mode for floats because there's no way to ensure the correct behaviour other than setting the rounding mode? |
Yes, exactly. |
It seems like this was an issue with the modes LLVM provides, which we can't do much about. I'm going to close this - feel free to reopen if I'm wrong in doing so. |
I think it would be nice to have a living issue for it, but this isn't it. |
A number of
round
methods which take a RoundingMode do not accept RoundNearest (but do accept the other modes). Evidence:This appears to be the case on 0.4 and master.
The missing methods are
round{T<:FloatingPoint}(::T, ::RoundingMode{:Nearest})
. There are other methods I found which depend on those, such asround(::Type{Int64}, ::Float64, ::RoundingMode{:Nearest})
.It seems to me like either
round(::Number, RoundingMode{:Nearest})
should callround(::Number)
or the reverse should be true. If the latter option is preferred, there's a bunch of code overhaul to do, and packages probably have to be updated as well.The text was updated successfully, but these errors were encountered: