[Ecm-commits] r2573 - trunk

cvs commits ecm-commits at lists.gforge.inria.fr
Sun Feb 1 07:36:27 CET 2015


Author: dcleaver
Date: 2015-02-01 07:36:26 +0100 (Sun, 01 Feb 2015)
New Revision: 2573

Modified:
   trunk/candi.c
Log:
Correct if/else-if to prevent double testing numbers

Modified: trunk/candi.c
===================================================================
--- trunk/candi.c	2015-01-31 22:16:03 UTC (rev 2572)
+++ trunk/candi.c	2015-02-01 06:36:26 UTC (rev 2573)
@@ -113,7 +113,7 @@
     {
       if (n->ndigits < APRCL_CUTOFF)
         n->isPrp = mpz_aprtcle (c, 0);
-      if (n->ndigits < APRCL_CUTOFF2)
+      else if (n->ndigits < APRCL_CUTOFF2)
         n->isPrp = mpz_aprtcle (c, 1);
       else
         n->isPrp = mpz_probab_prime_p (c, PROBAB_PRIME_TESTS);
@@ -156,7 +156,7 @@
   n->ndigits = nb_digits (n->n);
   if (n->ndigits < APRCL_CUTOFF)
     n->isPrp = mpz_aprtcle (n->n, 0);
-  if (n->ndigits < APRCL_CUTOFF2)
+  else if (n->ndigits < APRCL_CUTOFF2)
     n->isPrp = mpz_aprtcle (n->n, 1);
   else
     n->isPrp = mpz_probab_prime_p (n->n, PROBAB_PRIME_TESTS);



More information about the Ecm-commits mailing list