Using cmath's pow function doesn't seem to be working, pow (4, 1/3) returns 1.
How do I calculate cube roots properly?
You are being bitten by the (in)famous integer division. Try 1.0/3.
That fixed it.
By the way, is there any difference between 1.0 1. 1.f ?
1.0 and 1. are double
while 1.f and 1.0f mean float