Talk:Nth root

From Rosetta Code

Comparison to Non-integer Exponentiation

Okay, I get that this task calls for implementing a particular algorithm (convergence by successive approximation). However, it seems like it would be appropriate to describe (in comments perhaps) whether the language supports a more direct method of computing an nth root (such as raising a number to a fractional power: x ** (1/n) for the nth root of x).

For those languages which support it (non-integer exponentiation; or via any library function) I'd also recommend that the task specify that the code should compare the results of this algorithm versus the one obtained in the language's most natural native method. JimD 22:03, 3 August 2009 (UTC)

Exponentiation operators should be discussed in Math constants and functions. Comparisons could be added optionally. --Mwn3d 22:14, 3 August 2009 (UTC)
Math constants and functions does not ask for an Nth root function, though that is related to exponentation. --Rdm 15:16, 18 May 2010 (UTC)

C edit

I see the recent edits on C example as having multiple problems: 1) math function pow() was specifically avoided because it makes no sense to do nth root if we could just pow() it; 2) prec parameter is of wrong type; 3) when comparing for convergence, at least take the absolute value; and the comparison should be made against a relative value; 4) requiring 4 parameters is counterintuive. I'll let it stand for now in case the new editor will come and fix it, or it will be reverted. --Ledrug 22:40, 4 September 2011 (UTC)