Groups
Category
Integer overflow happens when a computed value exceeds the range of its type; in C++ this silently wraps for unsigned and is undefined for signed, so prevention is crucial.
Fast exponentiation (binary exponentiation) computes a^n using repeated squaring in O(log n) multiplications.