Logo

Programming-Idioms

This language bar is your friend. Select your favorite languages!
  • Python

Idiom #336 Exponent

Compute x = b

b raised to the power of n is equal to the product of n terms b × b × ... × b

x = b ** n
Value := Base ** Exponent;

Exponent's type must be an Integer >= 0 (Natural). Or, if Base is a floating point number, Exponent can be negative.

New implementation...