diff options
author | Martin Panter <vadmium+py@gmail.com> | 2016-05-08 12:22:37 (GMT) |
---|---|---|
committer | Martin Panter <vadmium+py@gmail.com> | 2016-05-08 12:22:37 (GMT) |
commit | 129fe04d4deec15f9ca0ee79776e0c4335fc12e7 (patch) | |
tree | e656ee64aecf4b810e6cd2c0ad1918b7159a9b2d /Doc/library | |
parent | ad1fd346b297cf8f03155d95c1135409893b3fac (diff) | |
download | cpython-129fe04d4deec15f9ca0ee79776e0c4335fc12e7.zip cpython-129fe04d4deec15f9ca0ee79776e0c4335fc12e7.tar.gz cpython-129fe04d4deec15f9ca0ee79776e0c4335fc12e7.tar.bz2 |
Issue #26512: Clarify Integral; tidy up table of rounding functions
Based on patch by Julien.
Diffstat (limited to 'Doc/library')
-rw-r--r-- | Doc/library/stdtypes.rst | 29 |
1 files changed, 16 insertions, 13 deletions
diff --git a/Doc/library/stdtypes.rst b/Doc/library/stdtypes.rst index 1a1b74c..80f4779 100644 --- a/Doc/library/stdtypes.rst +++ b/Doc/library/stdtypes.rst @@ -361,19 +361,22 @@ Notes: All :class:`numbers.Real` types (:class:`int` and :class:`float`) also include the following operations: -+--------------------+------------------------------------+--------+ -| Operation | Result | Notes | -+====================+====================================+========+ -| ``math.trunc(x)`` | *x* truncated to Integral | | -+--------------------+------------------------------------+--------+ -| ``round(x[, n])`` | *x* rounded to n digits, | | -| | rounding half to even. If n is | | -| | omitted, it defaults to 0. | | -+--------------------+------------------------------------+--------+ -| ``math.floor(x)`` | the greatest integral float <= *x* | | -+--------------------+------------------------------------+--------+ -| ``math.ceil(x)`` | the least integral float >= *x* | | -+--------------------+------------------------------------+--------+ ++--------------------+---------------------------------------------+ +| Operation | Result | ++====================+=============================================+ +| :func:`math.trunc(\| *x* truncated to :class:`~numbers.Integral` | +| x) <math.trunc>` | | ++--------------------+---------------------------------------------+ +| :func:`round(x[, | *x* rounded to *n* digits, | +| n]) <round>` | rounding half to even. If *n* is | +| | omitted, it defaults to 0. | ++--------------------+---------------------------------------------+ +| :func:`math.floor(\| the greatest :class:`~numbers.Integral` | +| x) <math.floor>` | <= *x* | ++--------------------+---------------------------------------------+ +| :func:`math.ceil(x)| the least :class:`~numbers.Integral` >= *x* | +| <math.ceil>` | | ++--------------------+---------------------------------------------+ For additional numeric operations see the :mod:`math` and :mod:`cmath` modules. |