For very large numbers you need bignum arithmetics, check out Arbitrary-precision arithmetic - Wikipedia, the free encyclopedia