Jump to navigation Jump to search
The classic method of calculating exponentiation:
- Start your output number at 1.
- If the exponent is odd, multiply the output by the base, and subtract 1 from the exponent.
- Divide the exponent by 2, and multiply the base by itself.
- If the exponent is still greater than 0, loop back to step 2.