summaryrefslogtreecommitdiffstats
path: root/Doc
diff options
context:
space:
mode:
authorMartin Panter <vadmium+py@gmail.com>2016-05-08 12:47:37 (GMT)
committerMartin Panter <vadmium+py@gmail.com>2016-05-08 12:47:37 (GMT)
commitcdbf38cbd60946f0d9fe53be2c16214099cd93cb (patch)
tree9f7bbc581bb5d4bb937099775c83be9716286741 /Doc
parentcacbc17d6721d5d433d6ccae576f6c5dbdc88e48 (diff)
downloadcpython-cdbf38cbd60946f0d9fe53be2c16214099cd93cb.zip
cpython-cdbf38cbd60946f0d9fe53be2c16214099cd93cb.tar.gz
cpython-cdbf38cbd60946f0d9fe53be2c16214099cd93cb.tar.bz2
Issue #26512: Clarify Integral; tidy up table of rounding functions
Based on patch by Julien.
Diffstat (limited to 'Doc')
-rw-r--r--Doc/library/stdtypes.rst29
1 files changed, 16 insertions, 13 deletions
diff --git a/Doc/library/stdtypes.rst b/Doc/library/stdtypes.rst
index 91d89f1..9224b81 100644
--- a/Doc/library/stdtypes.rst
+++ b/Doc/library/stdtypes.rst
@@ -393,19 +393,22 @@ Notes:
All :class:`numbers.Real` types (:class:`int`, :class:`long`, 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 ties away from zero. 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 ties away from zero. If *n* |
+| | is omitted, it defaults to 0. |
++--------------------+---------------------------------------------+
+| :func:`math.floor(\| the greatest integer as a float <= *x* |
+| x) <math.floor>` | |
++--------------------+---------------------------------------------+
+| :func:`math.ceil(x)| the least integer as a float >= *x* |
+| <math.ceil>` | |
++--------------------+---------------------------------------------+
.. XXXJH exceptions: overflow (when? what operations?) zerodivision