This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author rhettinger
Recipients mark.dickinson, rhettinger, tim.peters
Date 2020-09-21.01:01:54
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1600650114.4.0.96172232586.issue41823@roundup.psfhosted.org>
In-reply-to
Content
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):
        ...
History
Date User Action Args
2020-09-21 01:01:54rhettingersetrecipients: + rhettinger, tim.peters, mark.dickinson
2020-09-21 01:01:54rhettingersetmessageid: <1600650114.4.0.96172232586.issue41823@roundup.psfhosted.org>
2020-09-21 01:01:54rhettingerlinkissue41823 messages
2020-09-21 01:01:54rhettingercreate