NO

Author Topic: Nth Root  (Read 2977 times)

zk52959

  • Guest
Nth Root
« on: March 09, 2008, 04:50:00 PM »
In C, is there a standard function for calculating the Nth Root of a number?

If not, what is the most efficient way to calculate it?

severach

  • Guest
Re: Nth Root
« Reply #1 on: March 10, 2008, 12:40:22 AM »

zk52959

  • Guest
Re: Nth Root
« Reply #2 on: March 18, 2008, 01:40:16 PM »
I tried the algorithm above, but it only seems to work for limited conditions.

An engineer explained to me how I can use the pre-existing pow() function in the <math.h> standard library.


   inverseN = 1.0 / n;

   x = pow(A, inverseN);


This method seems to work for a wider set of conditions.