[issue8265] test_float fails on ARM Linux EABI with soft floating point
Mark Dickinson
report at bugs.python.org
Thu Apr 1 23:34:06 CEST 2010
Mark Dickinson <dickinsm at gmail.com> added the comment:
>From the values in the report, float.fromhex is giving the correct value here, but MIN-3*TINY is somehow coming out incorrectly.
Correct values (with Python 2.6, so old float repr; OS X 10.6.2):
Python 2.6.5+ (release26-maint:79559:79560, Apr 1 2010, 21:54:0)
[GCC 4.2.1 (Apple Inc. build 5646) (dot 1)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> float.fromhex('0x0.ffffffffffffd6p-1022')
2.2250738585071999e-308
>>> MIN = float.fromhex('0x1p-1022')
>>> TINY = float.fromhex('0x0.0000000000001p-1022')
>>> MIN
2.2250738585072014e-308
>>> TINY
4.9406564584124654e-324
>>> 3*TINY
1.4821969375237396e-323
>>> MIN - 3*TINY
2.2250738585071999e-308
>>> from math import ldexp
>>> ldexp(1.0, -1074)
4.9406564584124654e-324
It would be helpful to see the corresponding ARM outputs. I suspect a platform bug either in ldexp or in the multiplication or subtraction above.
----------
_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue8265>
_______________________________________
More information about the Python-bugs-list
mailing list