diff options
author | Mark Dickinson <dickinsm@gmail.com> | 2009-11-24 14:27:02 (GMT) |
---|---|---|
committer | Mark Dickinson <dickinsm@gmail.com> | 2009-11-24 14:27:02 (GMT) |
commit | 6b87f117caba3a6af28f0d0afb05515ae8997620 (patch) | |
tree | 73b2396c2562f2c64355df5cad7a3771b5360bd8 /Doc/faq | |
parent | 9a03f2fd03278d2c12dfe253de1bbed7c0c9c506 (diff) | |
download | cpython-6b87f117caba3a6af28f0d0afb05515ae8997620.zip cpython-6b87f117caba3a6af28f0d0afb05515ae8997620.tar.gz cpython-6b87f117caba3a6af28f0d0afb05515ae8997620.tar.bz2 |
Fix some documentation examples involving the repr of a float.
Diffstat (limited to 'Doc/faq')
-rw-r--r-- | Doc/faq/design.rst | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/Doc/faq/design.rst b/Doc/faq/design.rst index 94afaff..02e3fad 100644 --- a/Doc/faq/design.rst +++ b/Doc/faq/design.rst @@ -75,9 +75,9 @@ necessary to make ``eval(repr(f)) == f`` true for any float f. The ``str()`` function prints fewer digits and this often results in the more sensible number that was probably intended:: - >>> 0.2 - 0.20000000000000001 - >>> print 0.2 + >>> 1.1 - 0.9 + 0.20000000000000007 + >>> print 1.1 - 0.9 0.2 One of the consequences of this is that it is error-prone to compare the result |