Thank you, but the question is not how to make it work.

pow(int,var) works as is, without any typecasting.

But why would pow( (var)short, var) not work?