mpz_limbs interface

bodrato at mail.dm.unipi.it bodrato at mail.dm.unipi.it
Sun Feb 9 17:18:21 UTC 2014


Ciao,

Il Sab, 8 Febbraio 2014 9:50 am, Niels ha scritto:
> bodrato at mail.dm.unipi.it 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);

...

Regards,
m

-- 
http://bodrato.it/



More information about the gmp-devel mailing list