The pow() function returns the result of raising a number(base)  to a certain power(exponent), i.e., base^exponent.


pow(base, exp)

The base is the numeric value that we want to raise to some power, while the exp i.e exponent, is the value that indicates to how many times the base should be multiplied by itself.


pow(2, 2)
pow(25, 2)
pow(10.5, 5)
pow(100, 0.5)
pow(100, -0.5)

When both base and exponent are integers, the function accepts an optional third argument , the modulus, which is used to calculate the result of the expression in modula arithmetic. 


pow(base, exp, mod)

The expression gets solved as (base ^ exp % mod).


pow(3, 2, 3)
pow(5, 2, 3)
pow(8, 6, 5)
pow(10, 10, 15)
pow(3.5, 4, 5)
//TypeError: pow() 3rd argument not allowed unless all arguments are integers