Modular Exponentiation

Finds the remainder of a^b divided by m using repeated squaring. Because a^b is never formed in full, the exponent can be as large as you like. The number of digits a^b would have if written out is also shown.