The built-in Math.Pow() function in .NET raises a double base to a double exponent and returns a double result.
Math.Pow()
double
W
Another way is:
int Pow(int value, int pow) { var result = value; while (pow-- > 1) result *= value; return pow == 0 ? result : pow == -1 ? 1 : throw new ArgumentOutOfRangeException(nameof(pow)); }