[issue27353] Add nroot function to math

Steven D'Aprano report at bugs.python.org
Mon Jun 20 13:47:32 EDT 2016


Steven D'Aprano added the comment:

I suggested on python-ideas that the math module be given a pure-Python front end. Guido wasn't too keen on that idea, so I won't push for it.

He did agree that having nroot in math was a reasonable idea. If I attach a pure Python implementation and tests, is anyone interested in porting it to C? I'm afraid that "Hello World" is about the level of my C skills.

As far as the geometric mean goes, Serhiy refers to a comment about the naive calculation likely overflowing. That's true, but I don't intend to do a naive calculation. In any case, even if I don't end up use nroot for geometric mean, it will still be useful as a more explicit and more accurate alternative to pow(x, 1/n).

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue27353>
_______________________________________


More information about the Python-bugs-list mailing list