Try using the GNU MP Bignum Library....