Skip to content

Commit e6bf616

Browse files
tbwolfehugovk
authored andcommitted
pythongh-85988: Change documentation for sys.float_info.rounds (pythonGH-99675)
* Change documentation for sys.float_info.rounds Change the documentation for sys.float_info.rounds to remove references to C99 section 5.2.4.2.2 and instead place the available values inline. * Correction to previous documentation change Newlines were not preserved in generated HTML on previous commit. I have changes the list to a comma-separated list of values and their meanings. * Clarify source for value of FLT_ROUNDS Clarify the source of the FLT_ROUNDS value and change 'floating-point addition' to 'floating-point arithmetic' to indicate that the rounding mode applies to all arithmetic operations.
1 parent 2701a49 commit e6bf616

File tree

1 file changed

+12
-6
lines changed

1 file changed

+12
-6
lines changed

Doc/library/sys.rst

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -558,12 +558,18 @@ always available.
558558
+---------------------+----------------+--------------------------------------------------+
559559
| :const:`radix` | FLT_RADIX | radix of exponent representation |
560560
+---------------------+----------------+--------------------------------------------------+
561-
| :const:`rounds` | FLT_ROUNDS | integer constant representing the rounding mode |
562-
| | | used for arithmetic operations. This reflects |
563-
| | | the value of the system FLT_ROUNDS macro at |
564-
| | | interpreter startup time. See section 5.2.4.2.2 |
565-
| | | of the C99 standard for an explanation of the |
566-
| | | possible values and their meanings. |
561+
| :const:`rounds` | FLT_ROUNDS | integer representing the rounding mode for |
562+
| | | floating-point arithmetic. This reflects the |
563+
| | | value of the system FLT_ROUNDS macro at |
564+
| | | interpreter startup time: |
565+
| | | ``-1`` indeterminable, |
566+
| | | ``0`` toward zero, |
567+
| | | ``1`` to nearest, |
568+
| | | ``2`` toward positive infinity, |
569+
| | | ``3`` toward negative infinity |
570+
| | | |
571+
| | | All other values for FLT_ROUNDS characterize |
572+
| | | implementation-defined rounding behavior. |
567573
+---------------------+----------------+--------------------------------------------------+
568574

569575
The attribute :attr:`sys.float_info.dig` needs further explanation. If

0 commit comments

Comments
 (0)