you can have the "user" give both X and N, so they could choose regular square root of 9(x=9 n=2), or cubed root of 27 (x=27 n=3) quad root of 1296 (x=1296 n=4) ect
yes x, n, res all variables
x...
Type: Posts; User: Crossfire
you can have the "user" give both X and N, so they could choose regular square root of 9(x=9 n=2), or cubed root of 27 (x=27 n=3) quad root of 1296 (x=1296 n=4) ect
yes x, n, res all variables
x...
yeah go with what WhiteFlags said
double res = pow(x, (1/n));
is the same as
double res;
res = pow(x, (1/n));
where x is your whole number, and the n is the # of roots
ok so you want the square root and thats it, or do you want other roots, like cube root (cubed root of 27 = 3 meaning 3*3*3)