]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
gh-100425: Update tutorial docs related to sum() accuracy (FH-101854)
authorneuralstring <107343209+neuralstring@users.noreply.github.com>
Sun, 19 Feb 2023 16:39:03 +0000 (16:39 +0000)
committerGitHub <noreply@github.com>
Sun, 19 Feb 2023 16:39:03 +0000 (10:39 -0600)
Doc/tutorial/stdlib2.rst

index 0c101c1f20723503b6712b872d9b030ce5f6090b..33f311db3a24d23b312805a87e17e8a28217b4f4 100644 (file)
@@ -394,7 +394,7 @@ point::
 
    >>> sum([Decimal('0.1')]*10) == Decimal('1.0')
    True
-   >>> sum([0.1]*10) == 1.0
+   >>> 0.1 + 0.1 + 0.1 + 0.1 + 0.1 + 0.1 + 0.1 + 0.1 + 0.1 + 0.1 == 1.0
    False
 
 The :mod:`decimal` module provides arithmetic with as much precision as needed::