From: neuralstring <107343209+neuralstring@users.noreply.github.com> Date: Sun, 19 Feb 2023 16:39:03 +0000 (+0000) Subject: gh-100425: Update tutorial docs related to sum() accuracy (FH-101854) X-Git-Tag: v3.12.0a6~127 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=32df540635cacce1053ee0ef98ee23f3f6a43c02;p=thirdparty%2FPython%2Fcpython.git gh-100425: Update tutorial docs related to sum() accuracy (FH-101854) --- diff --git a/Doc/tutorial/stdlib2.rst b/Doc/tutorial/stdlib2.rst index 0c101c1f2072..33f311db3a24 100644 --- a/Doc/tutorial/stdlib2.rst +++ b/Doc/tutorial/stdlib2.rst @@ -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::