YoushouldhavereceivedacopyoftheGNUGeneralPublicLicensealongwith
the GNU MP Library test suite. If not, see https://www.gnu.org/licenses/. */
#include <stdio.h> #include <stdlib.h>
#include"gmp-impl.h" #include"tests.h"
#include"mpn/perfsqr.h"
/* check_modulo() exercises mpz_perfect_square_p on squares which cover each possiblequadraticresiduetoeachdivisorusedwithin mpn_perfect_square_p,ensuringthoseresiduesaren'tincorrectlyclaimed tobenon-residues.
Thevalues"(j*others)^2"coverallquadraticresiduesmoddivisor[i], butinnoparticularorder.jisrunfrom1<=j<=divisor[i]sothatzero
is excluded. A literal n==0 doesn't reach the residue tests. */
/* product of all divisors */
mpz_set_ui (alldiv, 1L); for (i = 0; i < numberof (divisor); i++)
mpz_mul_ui (alldiv, alldiv, divisor[i]);
for (i = 0; i < numberof (divisor); i++)
{ /* product of all divisors except i */
mpz_set_ui (others, 1L); for (j = 0; j < numberof (divisor); j++) if (i != j)
mpz_mul_ui (others, others, divisor[j]);
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.