[issue43088] Regression in math.hypot

Tim Peters report at bugs.python.org
Sun Jan 31 18:16:38 EST 2021


Tim Peters <tim at python.org> added the comment:

I agree this doesn't occur in 3.10, but think Raymond pasted wrong outputs. Here:

Python 3.10.0a4+ (heads/master:64fc105b2d, Jan 28 2021, 15:31:11)
[MSC v.1928 64 bit (AMD64)] on win32
>>> x  = 0.6102683302836215
>>> y1 = 0.7906090004346522
>>> y2 = y1 + 1e-16
>>> from math import hypot
>>> hypot(x, y1)
0.998744224772008
>>> hypot(x, y2)
0.9987442247720081

Those both appear to be the results "as if" computed to infinite precision and then correctly rounded back to Python's float precision.

----------
nosy: +tim.peters

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


More information about the Python-bugs-list mailing list