
March 11th, 2003, 11:00 PM
|
 |
Contributing User
|
|
Join Date: Jan 2003
Location: USA
|
|
|
I'm not sure what you are asking here. By "calculat[ing] the radical", I assume that you want to find any real root of any floating-point value.
The pow(double x, double y) function in math.h should do it, along with its long double cousin, powl(). They both calculate the value of x raised to the y power.
Pardon the explanation, but I don't know how far you had gotten in math. To take the n-th root of a number, x, you raise x to the 1/n power. Eg, the square root of x would be pow(x,0.5) and the 10th root of x would be pow(x,0.1).
Otherwise, you could use the log() and exp() functions:
x_to_the_n = exp(log(x)/n);
If I assumed wrong about your question, please let us know.
|