mpz_init_set_ui (a, 0L);
c = ULONG_MAX;
m2exp = 2;
gmp_randinit_lc_2exp (r, a, c, m2exp);
gmp_randseed_ui (r, 0L);
for (i = 0; i < 20; i++)
{
mpz_urandomb (a, r, 1L); if (mpz_cmp_ui (a, 1L) != 0)
{
printf ("check_bigc1: mpz_urandomb didn't give 1\n");
printf (" m2exp=%lu\n", m2exp);
gmp_printf (" got rand=%#ZX\n", a);
abort ();
}
}
mpz_clear (a);
gmp_randclear (r);
}
/* Checks parameters which triggered an assertion failure in the past.
Happened when limbs(a)+limbs(c) < bits_to_limbs(m2exp). */ void
check_bigm (void)
{
gmp_randstate_t rstate;
mpz_t a;
mpz_init_set_ui (a, 5L);
gmp_randinit_lc_2exp (rstate, a, 1L, 384L);
mpz_urandomb (a, rstate, 20L);
gmp_randclear (rstate);
mpz_clear (a);
}
/* Checks for seeds bigger than the modulus. */ void
check_bigs (void)
{
gmp_randstate_t rstate;
mpz_t sd, a; int i;
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.