bodrato at bodrato at
Thu Jun 21 19:03:11 CEST 2012


Il Ven, 15 Giugno 2012 7:07 am, Niels Möller ha scritto:
> bodrato at writes:

>> About documentation... shall we explicitly document a supported way to
>> obtain an mpn form an mpz, and viceversa? The following should always
>> mpz_export (np, &nn, -1, sizeof(mp_limb_t), 0, sizeof(mp_limb_t) * 8 -
>> mp_bits_per_limb, z);

> That seems quite awkward to me. I think it would make more sense to
> document the contents of an mpz_t.

If we allow programs to use the internal structure of an mpz_t, we will be
forced not to change it, for compatibility reasons...

The line above is, afaik, the only (direct) way currently supported to
obtain an mpn from the value of an mpz.

I think I'll add the line as an example on the mpz_export documentation.



More information about the gmp-devel mailing list