Function Details: pow

Description


Returns base to the power exp; if mod is present, return base to the power exp, modulo mod.


Extended Description


The pow() function returns the result of raising the first argument to the power of the second argument. If a third argument is present, it returns the result modulo that argument. For two-argument pow(base, exp), the result is the same as base**exp. The two-argument form is generally more efficient for computation.


Read More about pow from Python Documentation

Function Signature


pow(base: Union[int, float], exp: Union[int, float], mod: Optional[int] = None) -> Union[int, float]

Module: builtins

Parameters



Parameter List


  • base: Union[int, float]
  • exp: Union[int, float]
  • mod: Optional[int]

Return


Returns base raised to the power of exp. If mod is present, returns the result modulo mod.


Return Type


Union[int, float]

Output

Explanation

These examples show basic usage of pow() with positive and negative exponents.