Logo

Programming-Idioms

  • VB
  • Obj-C
  • Ruby

Idiom #336 Exponent

Compute x = b

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

Math::E ** (1i * Math::PI) + 1
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...