-
-
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
No mention of round(2.5) == 2.0
behavior on overview of rounding functions (but present in docstring)
#31943
Comments
See https://docs.julialang.org/en/v1/base/math/#Base.round-Tuple{Type,Any}, https://docs.julialang.org/en/v1/base/math/#Base.Rounding.RoundNearest. The links for https://docs.julialang.org/en/v1/manual/mathematical-operations/index.html#Rounding-functions-1 seem to all link to the Dates stdlib rounding methods though which is weird. For reasons, see https://mathematica.stackexchange.com/questions/2116/why-round-to-even-integers. |
@KristofferC I did get to the links you list, but I just worry that the simplistic description on the first page I landed on of |
They seem to be intentionally short descriptions. For those that want to read more they can always just go into the actual docstring. So to me, what needs to be fixed is that the links should go to the correct methods and not the Dates methods. |
round(2.5) == 2.0
behavior on online docs (but present in docstring)round(2.5) == 2.0
behavior on overview of rounding functions (but present in docstring)
I guess concern is that More generally, the conclusion in #8750 seemed to be that numerical computing was moving towards defaulting to rounding ties to nearest even integer, so it's less of a Julia-specific issue anyway, and more of a general shift that I was unaware of. |
The behavior
round(2.5) == 2.0
comes as a surprise to me, and when I went to the online docs to understand why, the only information I got wasround(x) | round x to the nearest integer
here.The docstring explains the issue (which remains odd default behavior to me) better, but it's a little hidden:
IMO it needs to be a lot clearer in the online docs. There's no mention at all of this behavior, or of
RoundingMode
on https://docs.julialang.org/en/v1/manual/mathematical-operations/index.html#Rounding-functions-1It would also be good to understand why this is the default behavior.. it goes against my intuition for rounding
The text was updated successfully, but these errors were encountered: