[issue31980] Special case log(x, 2), log(x, 10) and pow(2, x)

Serhiy Storchaka report at bugs.python.org
Wed Nov 8 15:17:57 EST 2017


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

Okay. I think that log(x, base) still will be monotonic, because log(x, nextafter(2, +INF)) <= log2(x) <= log(x, nextafter(2, -INF)).

I know about this limitation of prec_log(). It was just an example. Maybe  Tim know more robust and efficient algorithms.

Exposing exp2 in the math library would be less interesting, because we don't add errors in pow() and just call libm pow(). The latter can call exp2() internally if it provides more accuracy than exp(log(x)*y).

----------
resolution:  -> rejected
stage:  -> resolved
status: open -> closed

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


More information about the Python-bugs-list mailing list