Skip to content

Commit 82c9adb

Browse files
bpo-30940: Updating round() docs. (GH-6342)
(cherry picked from commit 900c48d) Co-authored-by: Lisa Roach <lisaroach14@gmail.com>
1 parent cef1f87 commit 82c9adb

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

Doc/library/functions.rst

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1315,11 +1315,12 @@ are always available. They are listed here in alphabetical order.
13151315
equally close, rounding is done toward the even choice (so, for example,
13161316
both ``round(0.5)`` and ``round(-0.5)`` are ``0``, and ``round(1.5)`` is
13171317
``2``). Any integer value is valid for *ndigits* (positive, zero, or
1318-
negative). The return value is an integer if called with one argument,
1319-
otherwise of the same type as *number*.
1318+
negative). The return value is an integer if *ndigits* is omitted or
1319+
``None``.
1320+
Otherwise the return value has the same type as *number*.
13201321

1321-
For a general Python object ``number``, ``round(number, ndigits)`` delegates to
1322-
``number.__round__(ndigits)``.
1322+
For a general Python object ``number``, ``round`` delegates to
1323+
``number.__round__``.
13231324

13241325
.. note::
13251326

0 commit comments

Comments
 (0)