Skip to content
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

Merged
merged 4 commits into from
Jul 29, 2024
Merged

Conversation

skirpichev
Copy link
Member

@skirpichev skirpichev commented Jul 24, 2024

* 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.
@ericsnowcurrently ericsnowcurrently removed their request for review July 24, 2024 16:38
@picnixz
Copy link
Contributor

picnixz commented Jul 24, 2024

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?)

Python/bltinmodule.c Show resolved Hide resolved
Python/bltinmodule.c Show resolved Hide resolved
@bedevere-app
Copy link

bedevere-app bot commented Jul 24, 2024

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 I have made the requested changes; please review again. I will then notify any core developers who have left a review that you're ready for them to take another look at this pull request.

@skirpichev

This comment was marked as outdated.

@bedevere-app
Copy link

bedevere-app bot commented Jul 24, 2024

Thanks for making the requested changes!

@ericsnowcurrently: please review the changes made to this pull request.

Copy link
Member

@ericsnowcurrently ericsnowcurrently left a 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.

@vstinner vstinner merged commit 169e713 into python:main Jul 29, 2024
38 of 41 checks passed
@vstinner
Copy link
Member

Merged, thank you.

@skirpichev skirpichev deleted the fix-sum-122234 branch July 29, 2024 04:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants