> I think a good thing to check would be a C version using libgmp. This is definitely the thing to do. It might sufficient for the code to take in a number as a decimal string, convert it to a gmp integer, and then convert it back to decimal.