[issue44364] Add non integral tests for `sqrt()`

Serhiy Storchaka report at bugs.python.org
Thu Jun 10 15:18:08 EDT 2021


Serhiy Storchaka <storchaka+cpython at gmail.com> added the comment:

>>> math.sqrt(2.5) == 2.5**0.5
True
>>> math.sqrt(25.25) == 25.25**0.5
True

If we test the precision of math.sqrt(), would not be better to test it with data for which naive way of calculating the root returns different result? For example 2921 is the smallest integers for which math.sqrt(x) > x**0.5, and 3541 is the smallest integers for which math.sqrt(x) < x**0.5.

----------
nosy: +serhiy.storchaka

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


More information about the Python-bugs-list mailing list