Weird but true pow(x,y) function

While everything everyone has said in true, and while it's silly to use the floating point pow() function here, you CAN fix your original code by causing the float to integer conversion to round instead of truncate:

And, while that is true, in this case using floating point code and rounding instead of using integer math is like mowing the lawn of your small condo with a brushhog. (or using a dump truck to haul a bag of dog food.) Totally wrong equipment for the operation at hand.