Issue 15985: merge from 3.2.
This commit is contained in:
commit
7c6c80d89f
|
@ -1098,18 +1098,18 @@ are always available. They are listed here in alphabetical order.
|
||||||
arguments starting at ``0``).
|
arguments starting at ``0``).
|
||||||
|
|
||||||
|
|
||||||
.. function:: round(x[, n])
|
.. function:: round(number[, ndigits])
|
||||||
|
|
||||||
Return the floating point value *x* rounded to *n* digits after the decimal
|
Return the floating point value *number* rounded to *ndigits* digits after
|
||||||
point. If *n* is omitted, it defaults to zero. Delegates to
|
the decimal point. If *ndigits* is omitted, it defaults to zero. Delegates
|
||||||
``x.__round__(n)``.
|
to ``number.__round__(ndigits)``.
|
||||||
|
|
||||||
For the built-in types supporting :func:`round`, values are rounded to the
|
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
|
closest multiple of 10 to the power minus *ndigits*; if two multiples are
|
||||||
close, rounding is done toward the even choice (so, for example, both
|
equally close, rounding is done toward the even choice (so, for example,
|
||||||
``round(0.5)`` and ``round(-0.5)`` are ``0``, and ``round(1.5)`` is ``2``).
|
both ``round(0.5)`` and ``round(-0.5)`` are ``0``, and ``round(1.5)`` is
|
||||||
The return value is an integer if called with one argument, otherwise of the
|
``2``). The return value is an integer if called with one argument,
|
||||||
same type as *x*.
|
otherwise of the same type as *number*.
|
||||||
|
|
||||||
.. note::
|
.. note::
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue