New submission from Steven D'Aprano:

For Issue27181 (add geometric mean to statistics module), I need a function to 
calculate nth roots that is more accurate than pow(x, 1/n). E.g. math.pow(1000, 
1/3) returns 9.999999999999998 instead of 10.0.

I have a pure-Python implementation of nroot which I believe is satisfactory, 
and I could use that, but I'm uncomfortable about making it a public function 
in statistics. It's not really a statistics function, its more general, and I 
think it would be generally useful enough that it should go into math.

To recap the options:

- leave nroot in statistics as a private function;
- leave it in statistics, but make it public;
- add it to math

I'm willing to do the first if there is no other alternative, reluctant to do 
the second, and think that the third is the most useful, but I don't have the 
ability to write a pure C version. If the math library was written in Python 
that would be the obvious place for it.

----------
components: Library (Lib)
messages: 268875
nosy: steven.daprano
priority: normal
severity: normal
status: open
title: Add nroot function to math
type: enhancement
versions: Python 3.6

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue27353>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to