Skip to content

Commit 900c48d

Browse files
lisroachserhiy-storchaka
authored andcommitted
bpo-30940: Updating round() docs. (GH-6342)
1 parent 9572132 commit 900c48d

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
@@ -1329,11 +1329,12 @@ are always available. They are listed here in alphabetical order.
13291329
equally close, rounding is done toward the even choice (so, for example,
13301330
both ``round(0.5)`` and ``round(-0.5)`` are ``0``, and ``round(1.5)`` is
13311331
``2``). Any integer value is valid for *ndigits* (positive, zero, or
1332-
negative). The return value is an integer if called with one argument,
1333-
otherwise of the same type as *number*.
1332+
negative). The return value is an integer if *ndigits* is omitted or
1333+
``None``.
1334+
Otherwise the return value has the same type as *number*.
13341335

1335-
For a general Python object ``number``, ``round(number, ndigits)`` delegates to
1336-
``number.__round__(ndigits)``.
1336+
For a general Python object ``number``, ``round`` delegates to
1337+
``number.__round__``.
13371338

13381339
.. note::
13391340

0 commit comments

Comments
 (0)