mpz_limbs interface

bodrato at bodrato at
Sun Feb 9 17:18:21 UTC 2014


Il Sab, 8 Febbraio 2014 9:50 am, Niels ha scritto:
> bodrato at writes:
>> So, maybe we can discuss about adding a new function to the _limbs
>> interface:
>> mp_ptr
>> mpz_init_limbs_write (mpz_t x, mp_size_t n)

> What is this intended for? Looks a bit like like mpz_init2.

mpz_limbs_write ignore the previous value of the mpz, so it makes sense to
use it just after init.
Of course you are right, it is possible to obtain the same with:

mpz_init2 (x, nn*GMP_NUMB_BITS);
np = mpz_limbs_write (x, nn);




More information about the gmp-devel mailing list