This theory is part of Premium
The full write-up (worked counting examples, the trap list and the interview playbook) unlocks with a Premium plan, along with every Pro visualizer.
See pricingCompute x^n where n can be negative.
What this asks
Compute x^n where n can be negative.
Flip the base once for a negative exponent, then fast exponentiate the magnitude; the exponent is copied to a wider type so the smallest int can be negated.
The full write-up (worked counting examples, the trap list and the interview playbook) unlocks with a Premium plan, along with every Pro visualizer.
See pricing