From: Martin Panter Date: Sun, 8 May 2016 12:47:37 +0000 (+0000) Subject: Issue #26512: Clarify Integral; tidy up table of rounding functions X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=cdbf38cbd60946f0d9fe53be2c16214099cd93cb;p=python Issue #26512: Clarify Integral; tidy up table of rounding functions Based on patch by Julien. --- diff --git a/Doc/library/stdtypes.rst b/Doc/library/stdtypes.rst index 91d89f15ed..9224b81aff 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) ` | | ++--------------------+---------------------------------------------+ +| :func:`round(x[, | *x* rounded to *n* digits, | +| n]) ` | rounding ties away from zero. If *n* | +| | is omitted, it defaults to 0. | ++--------------------+---------------------------------------------+ +| :func:`math.floor(\| the greatest integer as a float <= *x* | +| x) ` | | ++--------------------+---------------------------------------------+ +| :func:`math.ceil(x)| the least integer as a float >= *x* | +| ` | | ++--------------------+---------------------------------------------+ .. XXXJH exceptions: overflow (when? what operations?) zerodivision