You're getting integer-math'ed.
When floating point numbers are converted to integers, they are TRUNCATED, not rounded, and floating point numbers are not perfectly accurate; pow() returns a floating point number, but because it's floating point, it will be either a tiny bit higher or tiny bit lower than the actual value; when that
The solution is not to use floats when you don't absolutely need them (and when you think you do, pause a moment and consider if you really do). Floating point numbers are undesirable on Arduino platforms - they pull in bulky software implementations of floating point math operations if you do arithmatic with them, a 32-bit floating point number isn't accurate enough for you to ignore that inaccuracy, and it's very easy to introduce bugs when converting them to integers (as you have above). There are correct times to use floats, but this isn't one of them.
(Compare the flash used by your current code vs converting it to what JaBa said)