-
-
Notifications
You must be signed in to change notification settings - Fork 30.4k
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-122234: fix accuracy issues for sum() #122236
Conversation
* Use compensated summation for complex sums with floating-point items. This amends python#121176. * sum() specializations for floats and complexes now use PyLong_AsDouble() instead of PyLong_AsLongAndOverflow() and compensated summation as well.
I'm asking Victor and Raymond since I know that Victor has been reviewing Sergey's PR (and I think you also merged it) and Raymond since Sergey asked him a question on the issue. Are there other people I should ask (maybe Serhiy?) |
A Python core developer has requested some changes be made to your pull request before we can consider merging it. If you could please address their requests along with any other requests in other reviews from core developers that would be appreciated. Once you have made the requested changes, please leave a comment on this pull request containing the phrase |
This comment was marked as outdated.
This comment was marked as outdated.
Thanks for making the requested changes! @ericsnowcurrently: please review the changes made to this pull request. |
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.
Seems okay to me. However, you should have an expert on numeric stuff also take a look before this gets merged.
Merged, thank you. |
Use compensated summation for complex sums with floating-point items. This amends gh-121149: improve accuracy of builtin sum() for complex inputs #121176.
sum() specializations for floats and complexes now use PyLong_AsDouble() instead of PyLong_AsLongAndOverflow() and compensated summation as well.