How to calculate cube roots?

May 3, 2012 at 12:20am
Using cmath's pow function doesn't seem to be working, pow (4, 1/3) returns 1.
How do I calculate cube roots properly?
May 3, 2012 at 12:22am
You are being bitten by the (in)famous integer division. Try 1.0/3.
May 3, 2012 at 12:56am
That fixed it.
By the way, is there any difference between 1.0 1. 1.f ?
May 3, 2012 at 1:24am
1.0 and 1. are double
while 1.f and 1.0f mean float
Topic archived. No new replies allowed.