Maximum Size-In-Base of mpz_t

Paul Lou paul96lou at
Tue Jun 28 18:20:33 UTC 2016


I was wondering what the maximum size-in-base of mpz_t is.

I've been multiplying large numbers with gmp-6.1.0 and I personally got up
to ~41,000,000,000 in size of base 10 for mpz_t but could not get up to 82B
in size of base 10 (there's nothing special about 41B in my case, it's just
the size in base 10 that I ended up with for my purposes). When I multiply
two mpz_t's each with 41B in size of base 10, the result is a mpz_t with
only 29M in size of base 10 which is clearly incorrect. Do you have any
idea why this is occuring?

Is this error a result of the physical cap of the sizeinbase function or
the mpz_t struct? I saw on that
mpz_t's should support 2^50 limbs, so I would assume that the sizeinbase
function is not displaying the mpz_t correctly since the mpz_t should be
able to represent that large of a value.


More information about the gmp-discuss mailing list