Need help; trying to get the cubic root of a variable which I have declared as a defined integer, and getting a value of 0. What could I be doing wrong?
What language are you using? Try 1.0 instead of just 1 to force the result of the division to be a floating point number. For instance, in C#
Code:
int x = 8; // find the cube root of x, which should be 2
// This returns the wrong result because it uses integer division
Math.Pow(x, 1/3);
// This returns the correct result because it uses floating point division
Math.Pow(x, 1.0/3);