Question about mpz_set_str

Kevin Ryde
Sat, 04 Jan 2003 08:47:43 +1000

Minh Nguyen <> writes:
> Why does GMP have to reallocate memory when it is not necessary?

Generally to keep size calculations simpler and smaller.  There's no
sense making a complicated calculation just to shave one or two limbs
in certain cases.

It's left up to each mpz function to decide what it would like to
have, it just has to call MPZ_REALLOC and friends.