Message377237
Consider adding new non-sequence fields to sys.float_info: doubling_rounding and ieee_754.
The code in test_math defines a useful constant:
# detect evidence of double-rounding: fsum is not always correctly
# rounded on machines that suffer from double rounding.
x, y = 1e16, 2.9999 # use temporary values to defeat peephole optimizer
HAVE_DOUBLE_ROUNDING = (x + y == 1e16 + 4)
There is another useful value in a float.__getformat__ which is hard to find and only documented for internal use:
>>> float.__getformat__('double')
'IEEE, little-endian
Making this information available would make it easier for users to do what we do in test_math:
@requires_IEEE_754
@unittest.skipIf(HAVE_DOUBLE_ROUNDING,
"fsum is not exact on machines with double rounding")
def testFsum(self):
... |
|
Date |
User |
Action |
Args |
2020-09-21 01:01:54 | rhettinger | set | recipients:
+ rhettinger, tim.peters, mark.dickinson |
2020-09-21 01:01:54 | rhettinger | set | messageid: <1600650114.4.0.96172232586.issue41823@roundup.psfhosted.org> |
2020-09-21 01:01:54 | rhettinger | link | issue41823 messages |
2020-09-21 01:01:54 | rhettinger | create | |
|