diff options
author | Georg Brandl <georg@python.org> | 2008-07-01 20:39:59 (GMT) |
---|---|---|
committer | Georg Brandl <georg@python.org> | 2008-07-01 20:39:59 (GMT) |
commit | 809ddaaafb9c08bcf42e1a9e93dd2f9f604bdd41 (patch) | |
tree | 1e176f2987074a527d13d2b88e0bda00c157b8b5 /Doc | |
parent | 13b6d0df63e6f29c18d8e3ec93d1ab822543ebce (diff) | |
download | cpython-809ddaaafb9c08bcf42e1a9e93dd2f9f604bdd41.zip cpython-809ddaaafb9c08bcf42e1a9e93dd2f9f604bdd41.tar.gz cpython-809ddaaafb9c08bcf42e1a9e93dd2f9f604bdd41.tar.bz2 |
#3191: fix round() docs and docstring.
Diffstat (limited to 'Doc')
-rw-r--r-- | Doc/library/functions.rst | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/Doc/library/functions.rst b/Doc/library/functions.rst index a420974..4b1cbc6 100644 --- a/Doc/library/functions.rst +++ b/Doc/library/functions.rst @@ -964,11 +964,15 @@ are always available. They are listed here in alphabetical order. .. function:: round(x[, n]) Return the floating point value *x* rounded to *n* digits after the decimal - point. If *n* is omitted, it defaults to zero. Values are rounded to the + point. If *n* is omitted, it defaults to zero. Delegates to + ``x.__round__(n)``. + + For the built-in types supporting :func:`round`, values are rounded to the closest multiple of 10 to the power minus *n*; if two multiples are equally close, rounding is done toward the even choice (so, for example, both - ``round(0.5)`` and ``round(-0.5)`` are ``0``, and ``round(1.5)`` is - ``2``). Delegates to ``x.__round__(n)``. + ``round(0.5)`` and ``round(-0.5)`` are ``0``, and ``round(1.5)`` is ``2``). + The return value is an integer if called with one argument, otherwise of the + same type as *x*. .. function:: set([iterable]) |