[libmath-prime-util-perl] 06/181: Ensure M=alpha*n3 doesn't underflow

Partha P. Mukherjee ppm-guest at moszumanska.debian.org
Thu May 21 18:51:01 UTC 2015


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

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

commit 30e430d617fb90535206f72afb6e9efed3bdf30a
Author: Dana Jacobsen <dana at acm.org>
Date:   Wed Dec 11 14:01:58 2013 -0800

    Ensure M=alpha*n3 doesn't underflow
---
 lmo.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lmo.c b/lmo.c
index e7d6a82..7564120 100644
--- a/lmo.c
+++ b/lmo.c
@@ -450,7 +450,7 @@ UV _XS_LMO_pi(UV n)
   K3 = simple_pi(N3);        /* Pi(N3) */
 
   /* M is N^1/3 times a tunable performance factor. */
-  M = M_FACTOR(N3);
+  M = (N3 > 500) ? M_FACTOR(N3) : N3+N3/2;
   if (M >= N2) M = N2 - 1;         /* M must be smaller than N^1/2 */
   if (M < N3) M = N3;              /* M must be at least N^1/3 */
 

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



More information about the Pkg-perl-cvs-commits mailing list