The error is because parameters (int,int) do not match any directly and implicit casts are equally "good".
You don't need to cast the result, because that is implicit anyway. If the result is wrong, then a rounding floating points during conversion is the reason. You could try int z = pow( static_cast<double>(x), y ) + 0.1;
Then again, integer powers of integer 2 are bitshift operations. No need for pow.