Andrei Alexandrescu wrote:
On a non-degenerate base, any exponent greater than 32 (for int) and 64 (for long) would generate overflow. That can be figured with one test.
In fact probably all exponents can be special-cased to use the minimal amount of multiplications (which in the general case is not easy to figure).
Andrei
