-
-
Notifications
You must be signed in to change notification settings - Fork 30.3k
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
gh-94808: Cover handling non-finite numbers from round when ndigits is provided #94860
Conversation
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.
Interesting indeed!
Thanks @mdboom for the PR, and @brandtbucher for merging it 🌮🎉.. I'm working now to backport this PR to: 3.11. |
GH-94882 is a backport of this pull request to the 3.11 branch. |
…gits is provided (pythonGH-94860) (cherry picked from commit 625ba9b) Co-authored-by: Michael Droettboom <[email protected]>
…igits is provided (GH-94860) (GH-94882) (cherry picked from commit 625ba9b) Co-authored-by: Michael Droettboom <[email protected]> Automerge-Triggered-By: GH:brandtbucher
Thanks @mdboom for the PR, and @brandtbucher for merging it 🌮🎉.. I'm working now to backport this PR to: 3.11. |
Sorry, @mdboom and @brandtbucher, I could not cleanly backport this to |
This is an interesting corner case.
By default
round
returnsint
which can't represent non-finite numbers, so it throws various exceptions.When
ndigits
is provided,round
returnsfloat
, so non-finite numbers can be represented, and they just return what was passed in.Automerge-Triggered-By: GH:brandtbucher