[issue27353] Add nroot function to math

2021-08-20 Thread Mark Dickinson
Mark Dickinson added the comment: [Irit] > Is this still needed? It's not needed for geometric_mean. It's still a reasonable feature request, but it would be non-trivial effort to put a good quality implementation together - C doesn't have this function, so we can't simply wrap it like we

[issue27353] Add nroot function to math

2021-08-20 Thread Irit Katriel
Irit Katriel added the comment: Is this still needed? It was requested for issue27181, which has been resolved by now. -- nosy: +iritkatriel ___ Python tracker ___

[issue27353] Add nroot function to math

2016-06-25 Thread Steven D'Aprano
Steven D'Aprano added the comment: On Mon, Jun 20, 2016 at 09:02:09PM +, Tim Peters wrote: > Note that the very popular TI graphics calculators have had a distinct > nth-root function at least since the TI-83. It's a minor convenience > there. Likewise HP calculators ("xroot") and at

[issue27353] Add nroot function to math

2016-06-21 Thread Mark Dickinson
Mark Dickinson added the comment: [Serhiy] > ... nroot() wouldn't help too much to implement geometric mean It's fine, so long as it's only being called once or twice at the end of the calculation (it's even helpful to have the last operation be an nth root call, since that's a contracting

[issue27353] Add nroot function to math

2016-06-21 Thread Mark Dickinson
Mark Dickinson added the comment: [Raymond, quoting Matlab] > in cases where both real and complex roots exist, power returns only the > complex roots. Yes, this would be the main motivation for me, too, if only to be able to answer the many StackOverflow questions like this one:

[issue27353] Add nroot function to math

2016-06-20 Thread Tim Peters
Tim Peters added the comment: Note that the very popular TI graphics calculators have had a distinct nth-root function at least since the TI-83. It's a minor convenience there. I'm +0 on adding it to Python's math module, which means not enough to do any work ;-) Note that if it is added to

[issue27353] Add nroot function to math

2016-06-20 Thread Raymond Hettinger
Raymond Hettinger added the comment: If this ends up going forward (and I'm don't believe a good case has been made), I would prefer the function to be called "nth_root" which is unequivocal and readable (it is also close to what Matlab uses:

[issue27353] Add nroot function to math

2016-06-20 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: For general use I think it would be more useful to make pow() supporting fractions (using as_integer_ration()). >>> math.pow(1000, fractions.Fraction(2, 3)) 100.0 >>> math.pow(10, decimal.Decimal('0.4')) 100.0 --

[issue27353] Add nroot function to math

2016-06-20 Thread Steven D'Aprano
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,

[issue27353] Add nroot function to math

2016-06-20 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Looking at issue27181, nroot() wouldn't help too much to implement geometric mean (msg267990). -- nosy: +serhiy.storchaka ___ Python tracker

[issue27353] Add nroot function to math

2016-06-20 Thread Alexander Belopolsky
Changes by Alexander Belopolsky : -- nosy: +belopolsky ___ Python tracker ___

[issue27353] Add nroot function to math

2016-06-20 Thread Raymond Hettinger
Changes by Raymond Hettinger : -- nosy: +mark.dickinson, tim.peters ___ Python tracker ___

[issue27353] Add nroot function to math

2016-06-19 Thread Steven D'Aprano
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.998 instead of 10.0. I have a pure-Python implementation of nroot