summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMark Dickinson <dickinsm@gmail.com>2010-07-30 13:13:54 (GMT)
committerMark Dickinson <dickinsm@gmail.com>2010-07-30 13:13:54 (GMT)
commit7ce3f2ccdd318ace6de8515bfcf2ae72ec231a64 (patch)
treee9d1e53e7b17e3b8a338408825eec14a18d1a4c0
parent2da63cc338a0356a59ce42cad9af8e1e368c9fbf (diff)
downloadcpython-7ce3f2ccdd318ace6de8515bfcf2ae72ec231a64.zip
cpython-7ce3f2ccdd318ace6de8515bfcf2ae72ec231a64.tar.gz
cpython-7ce3f2ccdd318ace6de8515bfcf2ae72ec231a64.tar.bz2
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. ........
-rw-r--r--Doc/library/functions.rst7
1 files changed, 7 insertions, 0 deletions
diff --git a/Doc/library/functions.rst b/Doc/library/functions.rst
index 5160e08..a287732 100644
--- a/Doc/library/functions.rst
+++ b/Doc/library/functions.rst
@@ -961,6 +961,13 @@ are always available. They are listed here in alphabetical order.
The return value is an integer if called with one argument, otherwise of the
same type as *x*.
+ .. 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: