]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
gh-122234: fix accuracy issues for sum() (#122236)
authorSergey B Kirpichev <skirpichev@gmail.com>
Mon, 29 Jul 2024 03:56:40 +0000 (06:56 +0300)
committerGitHub <noreply@github.com>
Mon, 29 Jul 2024 03:56:40 +0000 (05:56 +0200)
commit169e7138ab84db465b6bf28e6c1dc6c39dbf89f4
tree21d936410ac4d1fee18f04f3223a688f71a3503c
parentbc93923a2dee00751e44da58b6967c63e3f5c392
gh-122234: fix accuracy issues for sum() (#122236)

* Use compensated summation for complex sums with floating-point items.
  This amends #121176.

* sum() specializations for floats and complexes now use
  PyLong_AsDouble() instead of PyLong_AsLongAndOverflow() and
  compensated summation as well.
Lib/test/test_builtin.py
Misc/NEWS.d/next/Core and Builtins/2024-07-24-17-11-51.gh-issue-122234.VxsP_F.rst [new file with mode: 0644]
Python/bltinmodule.c