-
-
Notifications
You must be signed in to change notification settings - Fork 718
Modify rounding method to use banker’s rounding #41268
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
base: develop
Are you sure you want to change the base?
Conversation
Update round method to use round-to-even for tie cases, aligning with Python 3 behavior and IEEE 754 default rounding.
|
Before that, such interesting thing raise: I think it is definitely a bug we need to fix |
|
Seems some doctests affects |
Update rounding behavior to match Python 3 and IEEE 754.
dimpase
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is a major change, potentially breaking other people's code.
I'd rather have an interface to change the rounding mode, say during the creation of the field.
If we want to make this rounding default, it must come via the usual depreciation route.
Yes. I know, we may merge it in 10.9 and we can take a deprecation notice? |
And we can create a interface to let people to choose the round way they need. |
|
I recommend reading the documentation of In practice, the edge cases for interval bounds are never significant. That's with the FP rounding internally is down for lower and up for upper bounds. You can do |
|
Documentation preview for this PR (built with commit ca533b0; changes) is ready! 🎉 |
Update round method to use round-to-even for tie cases, aligning with Python 3 behavior and IEEE 754 default rounding.
Fix #41056
📝 Checklist
⌛ Dependencies