+ = (expected value is 18014398509481982)
× = (expected value is 81129638414606663681390495662081)
^ = (expected value is 730750818665451215712927172538123444058715062271)


These algorithms are based on information from Matthew Crumley's pages on BigInteger addition and BigInteger multiplication. The exponentiation algorithm is from John Cook.

This program supports only unsigned addition and multiplication of base-10 integers. The maximum size of a word represented in the "digits" data structure can be adjusted by modifying the constructor. Large word lengths will cause problems if the sum or product of digits ends up exceeding 253-1.

9999999999999999 is an interesting value to experiment with. I had to bring the word length all the way down 7 to get the expected value (1017-1)2=99999999999999980000000000000001.