- Sponsor
-
Notifications
You must be signed in to change notification settings - Fork 5.6k
Fix bug when rounding large numbers to floating point types #54314
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
Conversation
Co-authored-by: mikmoore <[email protected]>
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. |
- fix #52355 using option 4 (round to nearest representable integer) - update docstrings *including documenting convert to Inf behavior even though Inf is not the "closest" floating point value* - add some assorted tests --------- Co-authored-by: mikmoore <[email protected]> (cherry picked from commit e7a1def)
- fix #52355 using option 4 (round to nearest representable integer) - update docstrings *including documenting convert to Inf behavior even though Inf is not the "closest" floating point value* - add some assorted tests --------- Co-authored-by: mikmoore <[email protected]> (cherry picked from commit e7a1def)
…g#54314) - fix JuliaLang#52355 using option 4 (round to nearest representable integer) - update docstrings *including documenting convert to Inf behavior even though Inf is not the "closest" floating point value* - add some assorted tests --------- Co-authored-by: mikmoore <[email protected]>
round(::Type{<:AbstractFloat}, x, ::RoundingMode)
violates docstring #52355 using option 4 (round to nearest representable integer)