[libmath-prime-util-perl] 01/02: Move Test::More to build vs. prereq; comment changes

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


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

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

commit 5ceba1714a18ab2965cf68d0f0458b9f21b5493f
Author: Dana Jacobsen <dana at acm.org>
Date:   Sun Jun 17 16:01:19 2012 -0500

    Move Test::More to build vs. prereq; comment changes
---
 Makefile.PL            |  4 +++-
 TODO                   | 10 ++++++++++
 lib/Math/Prime/Util.pm |  7 ++++++-
 util.c                 |  8 ++++++--
 4 files changed, 25 insertions(+), 4 deletions(-)

diff --git a/Makefile.PL b/Makefile.PL
index 16d53ac..f3e2d28 100644
--- a/Makefile.PL
+++ b/Makefile.PL
@@ -16,8 +16,10 @@ WriteMakefile1(
                     'util.o '  .
                     'XS.o',
 
+    BUILD_REQUIRES => {
+                    'Test::More'       => '0.45',
+                      },
     PREREQ_PM    => {
-                      'Test::More'       => '0.45',
                       'Exporter'         => '5.562',
                       'XSLoader'         => '0.01',
                       'Carp'             => '0',
diff --git a/TODO b/TODO
index 6134228..93c3a6a 100644
--- a/TODO
+++ b/TODO
@@ -12,9 +12,15 @@
 - Pure perl implementations
 
 - input validation (in XS, or do we need to make Perl wrappers for everything?)
+  We can do inpuut val in XS by looking at the NV.  But I think long term we'll
+  have a little Perl front end for everything to route to bignum routines or
+  regular routines.
 
 - Faster SQUFOF
 
+- Init a 1k static const with the 7/11/13 marks, and use that to init both
+  erat30 and segment_sieve.
+
 - speed up random_prime for large numbers
 
 - better prime count upper/lower bounds
@@ -27,3 +33,7 @@
 
 - Move .c / .h files into separate directory.
   version does it in a painful way.  Something simpler to be had?
+
+- Iterator or tie?
+
+- Get rid of erat_simple and bitarray.h.  They're only there for comparison.
diff --git a/lib/Math/Prime/Util.pm b/lib/Math/Prime/Util.pm
index bced723..cc22f8e 100644
--- a/lib/Math/Prime/Util.pm
+++ b/lib/Math/Prime/Util.pm
@@ -99,7 +99,12 @@ sub primes {
   elsif ($method =~ /^Sieve$/i)     { $sref = sieve_primes($low, $high); }
   else { croak "Unknown prime method: $method"; }
 
-  #return (wantarray) ? @{$sref} : $sref;
+  # Using this line:
+  #   return (wantarray) ? @{$sref} : $sref;
+  # would allow us to return an array ref in scalar context, and an array
+  # in array context.  Handy for people who might write:
+  #   @primes = primes(100);
+  # but I think the dual interface could bite us later.
   return $sref;
 }
 
diff --git a/util.c b/util.c
index b5ed802..614136f 100644
--- a/util.c
+++ b/util.c
@@ -785,10 +785,14 @@ UV nth_prime(UV n)
  *      by William H. Press et al.
  *
  * Any mistakes here are completely my fault.  This code has not been
- * verified for anything serious.  For better reulsts, see:
+ * verified for anything serious.  For better results, see:
  *    http://www.trnicely.net/pi/pix_0000.htm
  * which although the author claims are demonstration programs, will
- * produce more usable results than this code does.
+ * undoubtedly produce more reliable results than this code does (I don't
+ * know of any obvious issues with this code, but it just hasn't been used
+ * by many people).
+ *
+ * TODO: Verify error bounds at different ranges.
  */
 
 static double const euler_mascheroni = 0.57721566490153286060651209008240243104215933593992;

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