r83279 - in python/branches/release27-maint: Doc/library/functions.rst
![](https://secure.gravatar.com/avatar/8ac615df352a970211b0e3d94a307c6d.jpg?s=120&d=mm&r=g)
Author: mark.dickinson Date: Fri Jul 30 15:16:07 2010 New Revision: 83279 Log: Merged revisions 83277 via svnmerge from svn+ssh://pythondev@svn.python.org/python/branches/py3k ........ r83277 | mark.dickinson | 2010-07-30 14:13:02 +0100 (Fri, 30 Jul 2010) | 1 line Add note about surprising behaviour from round function. ........ Modified: python/branches/release27-maint/ (props changed) python/branches/release27-maint/Doc/library/functions.rst Modified: python/branches/release27-maint/Doc/library/functions.rst ============================================================================== --- python/branches/release27-maint/Doc/library/functions.rst (original) +++ python/branches/release27-maint/Doc/library/functions.rst Fri Jul 30 15:16:07 2010 @@ -1095,6 +1095,14 @@ example, ``round(0.5)`` is ``1.0`` and ``round(-0.5)`` is ``-1.0``). + .. note:: + + The behavior of :func:`round` for floats can be surprising: for example, + ``round(2.675, 2)`` gives ``2.67`` instead of the expected ``2.68``. + This is not a bug: it's a result of the fact that most decimal fractions + can't be represented exactly as a float. See :ref:`tut-fp-issues` for + more information. + .. function:: set([iterable]) :noindex:
participants (1)
-
mark.dickinson