Thread
:
How do I take a square root?
View Single Post
Oct 21st, 2006, 3:05 PM
#
3
Sane
Programming Guru
Join Date: Apr 2005
Posts: 1,827
Rep Power:
5
What niteice said. But you must also include the math.h library.
(
Toggle Plain Text
)
#include <math.h>
#include <math.h>
Then, for sake of listing alternatives, you can also do...
(
Toggle Plain Text
)
x_sqrt = pow(x, 0.5)
x_sqrt = pow(x, 0.5)
Although I'm not sure if "pow" accepts a float as a second argument.
Sane
View Public Profile
Find More Posts by Sane