This is an automated email from the git hooks/post-receive script.

ppm-guest pushed a commit to annotated tag v0.38
in repository libmath-prime-util-perl.

commit 4133fac1d739577c5fd227e4816a7730226ff533
Author: Dana Jacobsen <d...@acm.org>
Date:   Thu Feb 13 18:14:51 2014 -0800

    Slight speedup
---
 factor.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/factor.c b/factor.c
index cf028e6..29c3c7f 100644
--- a/factor.c
+++ b/factor.c
@@ -75,6 +75,7 @@ int factor(UV n, UV *factors)
           n /= f;
         }
       }
+      f = primes_small[sp];
     }
   }
   if (n < f*f) {
@@ -84,7 +85,7 @@ int factor(UV n, UV *factors)
   }
   /* Perfect squares and cubes.  Factor root only once. */
   {
-    int i, j, k = is_power(n,2) ? 2 : is_power(n,3) ? 3 : 1;
+    int i, j, k = is_power(n,2) ? 2 : (n >= f*f*f && is_power(n,3)) ? 3 : 1;
     if (k > 1) {
       UV p = (k == 2) ? isqrt(n) : icbrt(n);
       if (is_prob_prime(p)) {

-- 
Alioth's /usr/local/bin/git-commit-notice on 
/srv/git.debian.org/git/pkg-perl/packages/libmath-prime-util-perl.git

_______________________________________________
Pkg-perl-cvs-commits mailing list
Pkg-perl-cvs-commits@lists.alioth.debian.org
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/pkg-perl-cvs-commits

Reply via email to