mirror of https://github.com/python/cpython
gh-100425: Update tutorial docs related to sum() accuracy (FH-101854)
This commit is contained in:
parent
71f614ef2a
commit
32df540635
|
@ -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::
|
||||
|
|
Loading…
Reference in New Issue