mpz_limbs interface

Niels Möller nisse at lysator.liu.se
Tue Jan 21 15:30:32 UTC 2014


Torbjorn Granlund <tg at gmplib.org> writes:

> nisse at lysator.liu.se (Niels Möller) writes:
>
>   I see. In this particular case, I think the right gmp interface change
>   is to add mpn_urandomb and mpn_rrandomb (similar to current mpn_random
>   and mpn_random2, but with a randstate argument). If I understand this
>   correctly, the main obstacle is that random number internals use mpz
>   functions, which is an undesirable dependency for mpn functions.
>   
> We should indeed do this.

After 5.2?

> For testing the result, I'd write a wrapper C program that run old and
> new code in separate processes, and compare that the results are
> identical for the same (now and then regenerated) seeds.

If the generation is intended to be machine-independent, it would also
make sense to also add tests generating some random numbers from a few
fixed seeds, and compare to expected (constant) numbers.

Regards,
/Niels

-- 
Niels Möller. PGP-encrypted email is preferred. Keyid C0B98E26.
Internet email is subject to wholesale government surveillance.


More information about the gmp-devel mailing list