@@ -522,49 +522,55 @@ always available.
522
522
523
523
.. tabularcolumns :: |l|l|L|
524
524
525
- +---------------------+----------------+--------------------------------------------------+
526
- | attribute | float.h macro | explanation |
527
- +=====================+================+==================================================+
528
- | :const: `epsilon ` | DBL_EPSILON | difference between 1.0 and the least value |
529
- | | | greater than 1.0 that is representable as a float|
530
- | | | |
531
- | | | See also :func: `math.ulp `. |
532
- +---------------------+----------------+--------------------------------------------------+
533
- | :const: `dig ` | DBL_DIG | maximum number of decimal digits that can be |
534
- | | | faithfully represented in a float; see below |
535
- +---------------------+----------------+--------------------------------------------------+
536
- | :const: `mant_dig ` | DBL_MANT_DIG | float precision: the number of base-``radix `` |
537
- | | | digits in the significand of a float |
538
- +---------------------+----------------+--------------------------------------------------+
539
- | :const: `max ` | DBL_MAX | maximum representable positive finite float |
540
- +---------------------+----------------+--------------------------------------------------+
541
- | :const: `max_exp ` | DBL_MAX_EXP | maximum integer *e* such that ``radix**(e-1)`` is|
542
- | | | a representable finite float |
543
- +---------------------+----------------+--------------------------------------------------+
544
- | :const: `max_10_exp ` | DBL_MAX_10_EXP | maximum integer *e* such that ``10**e`` is in the|
545
- | | | range of representable finite floats |
546
- +---------------------+----------------+--------------------------------------------------+
547
- | :const: `min ` | DBL_MIN | minimum representable positive *normalized* float|
548
- | | | |
549
- | | | Use :func: `math.ulp(0.0) <math.ulp> ` to get the |
550
- | | | smallest positive *denormalized * representable |
551
- | | | float. |
552
- +---------------------+----------------+--------------------------------------------------+
553
- | :const: `min_exp ` | DBL_MIN_EXP | minimum integer *e* such that ``radix**(e-1)`` is|
554
- | | | a normalized float |
555
- +---------------------+----------------+--------------------------------------------------+
556
- | :const: `min_10_exp ` | DBL_MIN_10_EXP | minimum integer *e * such that ``10**e `` is a |
557
- | | | normalized float |
558
- +---------------------+----------------+--------------------------------------------------+
559
- | :const: `radix ` | FLT_RADIX | radix of exponent representation |
560
- +---------------------+----------------+--------------------------------------------------+
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. |
567
- +---------------------+----------------+--------------------------------------------------+
525
+ +---------------------+---------------------+--------------------------------------------------+
526
+ | attribute | float.h macro | explanation |
527
+ +=====================+=====================+==================================================+
528
+ | ``epsilon `` | ``DBL_EPSILON `` | difference between 1.0 and the least value |
529
+ | | | greater than 1.0 that is representable as a float|
530
+ | | | |
531
+ | | | See also :func: `math.ulp `. |
532
+ +---------------------+---------------------+--------------------------------------------------+
533
+ | ``dig `` | ``DBL_DIG `` | maximum number of decimal digits that can be |
534
+ | | | faithfully represented in a float; see below |
535
+ +---------------------+---------------------+--------------------------------------------------+
536
+ | ``mant_dig `` | ``DBL_MANT_DIG `` | float precision: the number of base-``radix `` |
537
+ | | | digits in the significand of a float |
538
+ +---------------------+---------------------+--------------------------------------------------+
539
+ | ``max `` | ``DBL_MAX `` | maximum representable positive finite float |
540
+ +---------------------+---------------------+--------------------------------------------------+
541
+ | ``max_exp `` | ``DBL_MAX_EXP `` | maximum integer *e* such that ``radix**(e-1)`` is|
542
+ | | | a representable finite float |
543
+ +---------------------+---------------------+--------------------------------------------------+
544
+ | ``max_10_exp `` | ``DBL_MAX_10_EXP `` | maximum integer *e* such that ``10**e`` is in the|
545
+ | | | range of representable finite floats |
546
+ +---------------------+---------------------+--------------------------------------------------+
547
+ | ``min `` | ``DBL_MIN `` | minimum representable positive *normalized* float|
548
+ | | | |
549
+ | | | Use :func: `math.ulp(0.0) <math.ulp> ` to get the |
550
+ | | | smallest positive *denormalized * representable |
551
+ | | | float. |
552
+ +---------------------+---------------------+--------------------------------------------------+
553
+ | ``min_exp `` | ``DBL_MIN_EXP `` | minimum integer *e* such that ``radix**(e-1)`` is|
554
+ | | | a normalized float |
555
+ +---------------------+---------------------+--------------------------------------------------+
556
+ | ``min_10_exp `` | ``DBL_MIN_10_EXP `` | minimum integer *e * such that ``10**e `` is a |
557
+ | | | normalized float |
558
+ +---------------------+---------------------+--------------------------------------------------+
559
+ | ``radix `` | ``FLT_RADIX `` | radix of exponent representation |
560
+ +---------------------+---------------------+--------------------------------------------------+
561
+ | ``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. |
573
+ +---------------------+---------------------+--------------------------------------------------+
568
574
569
575
The attribute :attr: `sys.float_info.dig ` needs further explanation. If
570
576
``s `` is any string representing a decimal number with at most
0 commit comments