If the problem is in power, how to write it down?
Try Math.pow(long, 1D/3) .
Math.pow(long, 1D/3)
By default, numeric literals in Java are considered int. Thus, 1/3 is converted to 0, not 0.33333, as it should be. Qualifying it with 1D or 1F or 1.0 will solve the problem.
This is due to the fact that 1/3 is a whole division and is evaluated as 0 . You effectively increase to 0 power, which always gives 1. Instead, try 1.0/3.0 .
1/3
0
1.0/3.0