How to use GMP.

Kevin Ryde user42@zip.com.au
Sat, 10 May 2003 07:50:01 +1000


Hashida <jhashida@fls.fujitsu.com> writes:
>
> How do the above four results express "(2^31-1)*3=6442450941"?

The values are 32-bits each, concatenated together.  _mp_d[0] is the
low half, _mp_d[1] the high.  So 2147483645 + 1 * 2^32 == 6442450941.

> In addition, what does "_mp_alloc" mean?

See "Internals" in the manual.  Ask again if that's unclear.

> Is "aaaaa._mp_alloc" 2 because "aaaaa" is used twice in mpz_*** ?

No, because _mp_d has been allocated space for 2 limbs.