]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
bpo-29677: DOC: clarify documentation for `round` (GH-877) (GH-892)
authorMariatta <Mariatta@users.noreply.github.com>
Thu, 30 Mar 2017 02:10:07 +0000 (19:10 -0700)
committerGitHub <noreply@github.com>
Thu, 30 Mar 2017 02:10:07 +0000 (19:10 -0700)
(cherry picked from commit 85deefcf61d3cc192846f41a4ccc6df17da60c98)

Doc/library/functions.rst

index 2c0ea71c47f413b637bd558ebdc4fc85cc2cec7d..90fb07af227d9879bbab84671a654e248fc77260 100644 (file)
@@ -1254,9 +1254,9 @@ are always available.  They are listed here in alphabetical order.
 
 .. function:: round(number[, ndigits])
 
-   Return the floating point value *number* rounded to *ndigits* digits after
-   the decimal point.  If *ndigits* is omitted or is ``None``, it returns the
-   nearest integer to its input.  Delegates to ``number.__round__(ndigits)``.
+   Return *number* rounded to *ndigits* precision after the decimal
+   point.  If *ndigits* is omitted or is ``None``, it returns the
+   nearest integer to its input.
 
    For the built-in types supporting :func:`round`, values are rounded to the
    closest multiple of 10 to the power minus *ndigits*; if two multiples are
@@ -1266,6 +1266,9 @@ are always available.  They are listed here in alphabetical order.
    negative).  The return value is an integer if called with one argument,
    otherwise of the same type as *number*.
 
+   For a general Python object ``number``, ``round(number, ndigits)`` delegates to
+   ``number.__round__(ndigits)``.
+
    .. note::
 
       The behavior of :func:`round` for floats can be surprising: for example,