Message354395
That's not a bug: 64-bit float of IEEE 754 rounds 1e-324 to 0.0.
vstinner@apu$ python3
Python 3.7.4 (default, Jul 9 2019, 16:32:37)
[GCC 9.1.1 20190503 (Red Hat 9.1.1-1)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> 1e-324
0.0
>>> import sys
>>> sys.float_info
sys.float_info(max=1.7976931348623157e+308, max_exp=1024, max_10_exp=308, min=2.2250738585072014e-308, min_exp=-1021, min_10_exp=-307, dig=15, mant_dig=53, epsilon=2.220446049250313e-16, radix=2, rounds=1)
>>> sys.float_info.min
2.2250738585072014e-308
>>> sys.float_info.min.hex()
'0x1.0000000000000p-1022'
>>> 1/0.0
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ZeroDivisionError: float division by zero
>>> 1/1e-324
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ZeroDivisionError: float division by zero |
|
Date |
User |
Action |
Args |
2019-10-10 16:19:04 | vstinner | set | recipients:
+ vstinner, Behzad Seyfi |
2019-10-10 16:19:04 | vstinner | set | messageid: <1570724344.03.0.528673906499.issue38432@roundup.psfhosted.org> |
2019-10-10 16:19:04 | vstinner | link | issue38432 messages |
2019-10-10 16:19:03 | vstinner | create | |
|