[Ecm-commits] r2527 - trunk

cvs commits ecm-commits at lists.gforge.inria.fr
Mon Oct 14 10:13:28 CEST 2013


Author: bouvierc
Date: 2013-10-14 10:13:28 +0200 (Mon, 14 Oct 2013)
New Revision: 2527

Log:
fix bug reported by Ben Meekins wi th savefile


Modified:
   trunk/factor.c
Modified: trunk/factor.c
===================================================================
--- trunk/factor.c	2013-08-28 09:28:12 UTC (rev 2526)
+++ trunk/factor.c	2013-10-14 08:13:28 UTC (rev 2527)
@@ -104,7 +104,7 @@
   int res; /* return value */
   int p_is_null;
   ecm_params q;
-  double B1done, B2scale, oldB1done;
+  double B1done, B2scale;
 
   if (mpz_cmp_ui (n, 0) <= 0)
     {
@@ -127,8 +127,6 @@
       p = q;
       ecm_init (q);
     }
-  else /* save original value */
-    oldB1done = p->B1done;
 
    /* Ugly hack to pass B2scale to the library somehow. It gets piggy-backed
       onto B1done. The next major release will have to allow for variable
@@ -185,8 +183,10 @@
 
   if (p_is_null)
     ecm_clear (q);
-  else /* restore original value */
-    p->B1done = oldB1done;
+  else /* restore original B2scale value */
+       /* Here's an ugly hack to pass B2scale to the library somehow.
+          It gets piggy-backed onto B1done */
+      p->B1done = p->B1done + floor (B2scale * 128.) / 134217728.; 
 
   return res;
 }




More information about the Ecm-commits mailing list