8000 GH-100425: Improve accuracy of builtin sum() for float inputs by rhettinger · Pull Request #100426 · python/cpython · GitHub
[go: up one dir, main page]

Skip to content

GH-100425: Improve accuracy of builtin sum() for float inputs #100426

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

Merged
merged 13 commits into from
Dec 23, 2022
Merged
Prev Previous commit
Mark as an implementation detail.
  • Loading branch information
rhettinger committed Dec 23, 2022
commit 3cf9536ad7210bf5090b6e8e517130dd4c3d9a1a
1 change: 1 addition & 0 deletions Lib/test/test_builtin.py
Original file line number Diff line number Diff line change
Expand Up @@ -1654,6 +1654,7 @@ def __getitem__(self, index):
@requires_IEEE_754
@unittest.skipIf(HAVE_DOUBLE_ROUNDING,
"sum accuracy not guaranteed on machines with double rounding")
@support.cpython_only # Other implementations may choose a different algorithm
def test_sum_accuracy(self):
self.assertEqual(sum([0.1] * 10), 1.0)
self.assertEqual(sum([1.0, 10E100, 1.0, -10E100]), 2.0)
Expand Down
0