A question about mpz_out_str and mpz_out_raw output limitation
Torbjörn Granlund
tg at gmplib.org
Tue Jun 24 10:53:08 UTC 2014
Nikitin Kirill <kirill.nikitin at epfl.ch> writes:
I'm currently working with large sets of public-key moduli using
gmp-6.0.0 for arbitrary precision arithmetic. There is a need to
multiple all unique primes from moduli together so final number is
getting huge sometimes (the sets sometimes include about 10 000 000
moduli).
I have encountered a problem that mpz_out_raw has a limitation for
printing numbers to a file, precisely 2^31 bytes (mpz_inp_raw has the
same accordingly). When numbers are bigger, the output is wrong (maybe
shrunken). Therefore, I'm wondering if it is possible to remove this
limitation in some way? and whether mpz_out_str (mpz_inp_str) has the
same limitation?
The mpz functions will not work for numbers that have more than 2^37
bits (assuming the host uses 64-bit pointers and limbs).
Torbjörn
Please encrypt, key id 0xC8601622
More information about the gmp-discuss
mailing list