Copyright 2002, 2011 Free Software Foundation, Inc.
This file is part of the GNU MP Library test suite.
The GNU MP Library test suite is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version.
The GNU MP Library test suite is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with
the GNU MP Library test suite. If not, see https://www.gnu.org/licenses/. */
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.