[issue14245] float rounding examples in FAQ are outdated

Zbyszek Szmek report at bugs.python.org
Sat Mar 10 10:35:12 CET 2012


New submission from Zbyszek Szmek <zbyszek at in.waw.pl>:

http://docs.python.org/dev/faq/design.html#why-are-floating-point-calculations-so-inaccurate

This whole paragraph is wrong since #9337 (Make float.__str__ behave identically to float.__repr__).
"""
The str() function prints fewer digits and this often results in the more sensible number that was probably intended:
>>> 1.1 - 0.9
0.20000000000000007
>>> print(1.1 - 0.9)
0.2
"""

Applies from 3.2 onwards.

----------
assignee: docs at python
components: Documentation
messages: 155300
nosy: docs at python, zbysz
priority: normal
severity: normal
status: open
title: float rounding examples in FAQ are outdated
versions: Python 3.2, Python 3.3

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue14245>
_______________________________________


More information about the Python-bugs-list mailing list