Powers: How to Calculate Base to the Exponent

Calculates base^exponent.

A power is repeated multiplication: the base multiplied by itself as many times as the exponent says.

an=a×a××aa^n = a \times a \times \cdots \times a

Example

Take a base of 2 and an exponent of 10. Multiplying 2 by itself ten times gives

210=10242^{10} = 1024

The powers of 2 double at every step: 2, 4, 8, 16, 32, 64, 128, 256, 512, 1024. That last value is worth recognising, since 1024 bytes is what computing calls a kilobyte.

Notes