[libmath-prime-util-perl] 04/181: A fix for prime counts > 18446744056529682436

Partha P. Mukherjee ppm-guest at moszumanska.debian.org
Thu May 21 18:51:00 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 535d480597924227f0efd5d7471b6a68cd6e154d
Author: Dana Jacobsen <dana at acm.org>
Date:   Wed Dec 11 11:08:31 2013 -0800

    A fix for prime counts > 18446744056529682436
---
 lmo.c | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/lmo.c b/lmo.c
index 30815c3..c1a803e 100644
--- a/lmo.c
+++ b/lmo.c
@@ -14,14 +14,16 @@
  * This file is part of the Math::Prime::Util Perl module, but it should
  * not be difficult to turn it into standalone code.
  *
- * The main references I used were:
+ * The algorithm details are based on Christian Bau's earlier work.
+ *
+ * References:
  *  - Christian Bau's paper and example implementation, 2003, Christian Bau
  *    This was of immense help.  References to "step #" refer to this preprint.
  *  - "Computing Pi(x): the combinatorial method", 2006, Tomás Oliveira e Silva
  *  - "Computing Pi(x): The Meissel, Lehmer, Lagarias, Miller, Odlyzko Method"
  *    1996, Deléglise and Rivat.
  *
- * Comparisons to the other prime counting implementations here:
+ * Comparisons to the other prime counting implementations in this package:
  *
  * Meissel: Combinatorial phi.  Simple implementation.
  * Lehmer:  Combinatorial phi.  Memory use grows rapidly.
@@ -496,7 +498,7 @@ UV _XS_LMO_pi(UV n)
   end = (M+1)/2;
 
   /* Start at index K2, which is the prime preceeding N^1/2 */
-  prime = prev_sieve_prime(N2+1);
+  prime = prev_sieve_prime( (N2 >= ps_start) ? ps_start : N2+1 );
   prime_index = K2 - 1;
   step7_max = K3;
 

-- 
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