Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
809ddaaa
Commit
809ddaaa
authored
Jul 01, 2008
by
Georg Brandl
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
#3191: fix round() docs and docstring.
parent
13b6d0df
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
5 deletions
+9
-5
Doc/library/functions.rst
Doc/library/functions.rst
+7
-3
Python/bltinmodule.c
Python/bltinmodule.c
+2
-2
No files found.
Doc/library/functions.rst
View file @
809ddaaa
...
...
@@ -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
])
...
...
Python/bltinmodule.c
View file @
809ddaaa
...
...
@@ -1726,8 +1726,8 @@ PyDoc_STRVAR(round_doc,
"round(number[, ndigits]) -> floating point number
\n
\
\n
\
Round a number to a given precision in decimal digits (default 0 digits).
\n
\
This returns an int when called with one argument, otherwise a
float.
\n
\
Precision
may be negative."
);
This returns an int when called with one argument, otherwise a
the
\n
\
same type as the number. ndigits
may be negative."
);
static
PyObject
*
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment