A question about mpz_out_str and mpz_out_raw output limitation

David Gillies daggillies at gmail.com
Tue Jun 24 22:06:12 UTC 2014

Forgot about sign of size bit. Presumably the inability to fully represent
the 2^37 bit values available in 64-bit code is a legacy issue from the
days when 2GB mpz_t's were infeasibly large. Perhaps a trivial extension
(which would break portability, alas) would be to prepend a single byte
indicating the length of the size header. In addition, mpz_out_raw
allocates a temporary roughly as big as the integer before writing to file.
I can see this causing problems.

More information about the gmp-discuss mailing list