I looked at the solution, and understand the method (maybe not fully which leads me to the question below).
Is there a reason why we have the following in the code
int power = 32;
Why do we start with power as 32 ? and not higher or any other number?
Also, if y is zero (0), the code (at least the Java version) does not protect against divide by zero - and runs indefinitely.