random number
José de Jesús Angel Angel
jjaa at math.com.mx
Wed Mar 18 04:50:56 CET 2009
Hello
I would like know if this is the best way for generating a randon number
of 160 bits.
What I have to do for improve this.
unsigned long int seed;
mpz_t temp;
gmp_randstate_t state;
mpz_init(temp);
gmp_randinit_default(state);
seed= rand();
gmp_randseed_ui (state,seed);
mpz_urandomb(temp, state, 160);
mpz_out_str (NULL, 10, temp);
cout << endl;
mpz_clear(temp);
More information about the gmp-discuss
mailing list