[issue41823] Add more fields to sys.float_info

Mark Dickinson report at bugs.python.org
Tue Sep 22 13:20:06 EDT 2020


Mark Dickinson <dickinsm at gmail.com> added the comment:

Double rounding is a property of how operations on floats are carried out, rather than being a property of the float format itself; I'm not sure that it belongs in float_info. It's also potentially ill-defined. Right now, as far as I *know*, it seems to be the case that our builds of CPython on x86 or x64 either consistently use x87+extended precision for all floating-point operations, or they consistently use SSE2 for all floating-point operations, but there's no reason that a build couldn't use SSE2 in some cases and x87+extended precision in others. (There are also subtle differences between x87+53-bit precision setting and IEEE 754-following SSE2.)

We also don't have any _reliable_ way to tell whether floats use IEEE 754, though we do have some ad-hoc ways that seem to work in practice (at least for now).

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue41823>
_______________________________________


More information about the Python-bugs-list mailing list