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
Fix bug when rounding large numbers to floating point types #54314
Conversation
Co-authored-by: mikmoore <95002244+mikmoore@users.noreply.github.com>
CI is very red, but all of the failures look very unrelated (internet or file system) and master has been red for a while. |
Oops. Only now did I realize that a docstring update may still be needed. I expect there are situations where an |
I don't think so julia> Base.infer_effects(round, Tuple{Type{Float64}, Int})
(+c,+e,+n,+t,+s,+m,+u)
Yes: julia> floor(UInt8, 1000)
ERROR: InexactError: trunc(UInt8, 1000) We also have
in the docstring already.
Do you have a specific behavior that isn't documented? For the most part I think this PR is doing a bugfix to change behavior to match what was already quasi-documented. |
Sorry. You're right. It's all covered. I just looked at this first thing in the morning and my brain wasn't working. It talks about rounding to representable values. |
round(::Type{<:AbstractFloat}, x, ::RoundingMode)
violates docstring #52355 using option 4 (round to nearest representable integer)