You mean big integers ? Knuth has written a lot of algorithms for these type of integers. In fact they are the kernels of RSA cryptographic algortihms. I don't know if there are available libraries but you should read the following book to understand the theory behing those numbers: "The art of computer programming. 2 : Seminumerical algorithms" / Donald E. Knuth Jonathan de Halleux, Belgium.