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

Mark Dickinson report at bugs.python.org
Wed Nov 8 16:20:49 EST 2017


Mark Dickinson <dickinsm at gmail.com> added the comment:

> Exposing exp2 in the math library would be less interesting

I disagree: a libm exp2 is likely to be significantly accurate than pow(2.0, x). The latter is unlikely to be special-cased by the libm pow.

> The latter can call exp2() internally if it provides more accuracy than exp(log(x)*y).

It would be a very poor pow implementation that used exp(log(x)*y).

----------

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


More information about the Python-bugs-list mailing list