AntInLoop

Fast Exponentiation (Binary Exponentiation) Interactive Visualizer

Fast Exponentiation computes a^n (or a^n mod M, or matrix powers A^n) in O(log n) multiplications by decomposing the exponent n into its binary representation.

Study Fast Exponentiation (Binary Exponentiation) Explanation · View Multi-Language Code · All Algorithms