|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
1200+ fellow developers rate and compare features of the top IDEs, like Visual Studio, Eclipse, RAD, Delphi and others, across 13 categories. Enjoy this FREE Download of the IDE User Satisfaction Study by Evans Data Corporation. Download Now!
|
|
#1
|
||||
|
||||
|
radicals?
If I wanted to calculated the radical of 5/4 how would i do that in C++? Not sure of the syntax and I don't believe math.h has a radical function. Thanks.
-andy
__________________
hmmm... |
|
#2
|
||||
|
||||
|
nevermind..im an idiot..its in math.h
|
|
#3
|
||||
|
||||
|
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. |
![]() |
| Viewing: Dev Shed Forums > Programming Languages > C Programming > radicals? |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|