mirror of
https://github.com/python/cpython.git
synced 2025-11-03 03:22:27 +00:00
gh-100425: Update tutorial docs related to sum() accuracy (FH-101854)
This commit is contained in:
parent
71f614ef2a
commit
32df540635
1 changed files with 1 additions and 1 deletions
|
|
@ -394,7 +394,7 @@ point::
|
||||||
|
|
||||||
>>> sum([Decimal('0.1')]*10) == Decimal('1.0')
|
>>> sum([Decimal('0.1')]*10) == Decimal('1.0')
|
||||||
True
|
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
|
False
|
||||||
|
|
||||||
The :mod:`decimal` module provides arithmetic with as much precision as needed::
|
The :mod:`decimal` module provides arithmetic with as much precision as needed::
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue