Fix bug when rounding large numbers to floating point types#54314
Fix bug when rounding large numbers to floating point types#54314LilithHafner merged 7 commits intomasterfrom
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. |
- 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 <95002244+mikmoore@users.noreply.github.com> (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 <95002244+mikmoore@users.noreply.github.com> (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 <95002244+mikmoore@users.noreply.github.com>
round(::Type{<:AbstractFloat}, x, ::RoundingMode)violates docstring #52355 using option 4 (round to nearest representable integer)