mpz_urandomm function return the same value

Creatxr creatxr at gmail.com
Wed Sep 21 17:27:04 CEST 2011


Hi,
could somebody tell me why it always the same value with function
"mpz_unrandmm".
thanks.
----------------------------------------------------------------
    mpz_t rop, n;
    gmp_randstate_t state;
    mpz_init(rop); mpz_init(n);
    gmp_randinit_default(state);

    mpz_set_ui(n, o);
    mpz_urandomm(rop, state, n);   ////////////////// rop return the same value
    r.setValue(rop); //////////////////set rop the r object field, rop
is always the same value

    gmp_randclear(state);
    mpz_clear(rop); mpz_clear(n);


More information about the gmp-discuss mailing list