8000 Update tutorial docs related to sum() accuracy · neuralstring/cpython@518c1af · GitHub
[go: up one dir, main page]

Skip to content

Commit 518c1af

Browse files
authored
Update tutorial docs related to sum() accuracy
Related to python#100426
1 parent 6ef6915 commit 518c1af

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Doc/tutorial/stdlib2.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -394,7 +394,7 @@ point::
394394

395395
>>> sum([Decimal('0.1')]*10) == Decimal('1.0')
396396
True
397-
>>> sum([0.1]*10) == 1.0
397+
>>> 0.1 + 0.1 + 0.1 + 0.1 + 0.1 + 0.1 + 0.1 + 0.1 + 0.1 + 0.1 == 1.0
398398
False
399399

400400
The :mod:`decimal` module provides arithmetic with as much precision as needed::

0 commit comments

Comments
 (0)
0