Skip to content

Commit 6562939

Browse files
authored
gh-85988: Change documentation for sys.float_info.rounds (GH-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 22860db commit 6562939

File tree

1 file changed

+12
-6
lines changed

1 file changed

+12
-6
lines changed

Doc/library/sys.rst

+12-6
Original file line numberDiff line numberDiff line change
@@ -604,12 +604,18 @@ always available.
604604
+---------------------+----------------+--------------------------------------------------+
605605
| :const:`radix` | FLT_RADIX | radix of exponent representation |
606606
+---------------------+----------------+--------------------------------------------------+
607-
| :const:`rounds` | FLT_ROUNDS | integer constant representing the rounding mode |
608-
| | | used for arithmetic operations. This reflects |
609-
| | | the value of the system FLT_ROUNDS macro at |
610-
| | | interpreter startup time. See section 5.2.4.2.2 |
611-
| | | of the C99 standard for an explanation of the |
612-
| | | possible values and their meanings. |
607+
| :const:`rounds` | FLT_ROUNDS | integer representing the rounding mode for |
608+
| | | floating-point arithmetic. This reflects the |
609+
| | | value of the system FLT_ROUNDS macro at |
610+
| | | interpreter startup time: |
611+
| | | ``-1`` indeterminable, |
612+
| | | ``0`` toward zero, |
613+
| | | ``1`` to nearest, |
614+
| | | ``2`` toward positive infinity, |
615+
| | | ``3`` toward negative infinity |
616+
| | | |
617+
| | | All other values for FLT_ROUNDS characterize |
618+
| | | implementation-defined rounding behavior. |
613619
+---------------------+----------------+--------------------------------------------------+
614620

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

0 commit comments

Comments
 (0)