[libmath-prime-util-perl] 14/50: Add primes.pl script

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


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

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

commit 480b5a291a042d3a6aa605a4b7c8894efaf50afe
Author: Dana Jacobsen <dana at acm.org>
Date:   Tue Oct 16 04:40:33 2012 -0600

    Add primes.pl script
---
 Changes       | 7 +++++--
 MANIFEST      | 5 +++++
 Makefile.PL   | 2 ++
 TODO          | 5 +++++
 bin/primes.pl | 4 +++-
 5 files changed, 20 insertions(+), 3 deletions(-)

diff --git a/Changes b/Changes
index 8a8631b..c49d641 100644
--- a/Changes
+++ b/Changes
@@ -1,7 +1,9 @@
 Revision history for Perl extension Math::Prime::Util.
 
-0.12  2 August 2012
-    - Add:
+0.12  2 November 2012
+    - Add bin/primes.pl
+
+    - Add functions:
            primorial               product of primes <= n
            pn_primorial            product of first n primes
            prime_set_config        set config options
@@ -16,6 +18,7 @@ Revision history for Perl extension Math::Prime::Util.
 
     - Use long doubles for math functions.
 
+    - Some fixes and speedups for ranged primes().
 
 0.11  23 July 2012
     - Turn off threading tests on Cygwin, as threads on some Cygwin platforms
diff --git a/MANIFEST b/MANIFEST
index 1c8d216..1cce79e 100644
--- a/MANIFEST
+++ b/MANIFEST
@@ -23,11 +23,15 @@ examples/bench-factor.pl
 examples/bench-factor-extra.pl
 examples/bench-factor-semiprime.pl
 examples/bench-is-prime.pl
+examples/bench-isprime-bpsw.pl
 examples/bench-miller-rabin.pl
 examples/bench-nthprime.pl
 examples/bench-pcapprox.pl
 examples/bench-primecount.pl
 examples/bench-random-prime.pl
+examples/bench-pp-count.pl
+examples/bench-pp-isprime.pl
+examples/bench-pp-sieve.pl
 examples/test-factor-yafu.pl
 examples/test-factor-mpxs.pl
 examples/test-nextprime-yafu.pl
@@ -37,6 +41,7 @@ examples/test-nthapprox.pl
 examples/test-pcapprox.pl
 examples/sophie_germain.pl
 examples/twin_primes.pl
+bin/primes.pl
 t/01-load.t
 t/02-can.t
 t/03-init.t
diff --git a/Makefile.PL b/Makefile.PL
index 7994601..d444392 100644
--- a/Makefile.PL
+++ b/Makefile.PL
@@ -14,6 +14,8 @@ WriteMakefile1(
                     'XS.o',
     LIBS         => ['-lm'],
 
+    EXE_FILES    => ['bin/primes.pl'],
+
     BUILD_REQUIRES=>{
                       'Test::More'       => '0.45',
                       'bignum'           => '0.23',   # Used for bigint tests
diff --git a/TODO b/TODO
index 4b7b42d..184d884 100644
--- a/TODO
+++ b/TODO
@@ -24,3 +24,8 @@
 - tests for primorial
 
 - document prime_set_config
+
+- Test all routines for numbers on word-size boundary, or ranges that cross.
+
+- Test all functions return either native or bigints.  Functions that return
+  raw MPU::GMP results will return strings, which isn't right.
diff --git a/bin/primes.pl b/bin/primes.pl
index 0b97635..9e73a8d 100755
--- a/bin/primes.pl
+++ b/bin/primes.pl
@@ -9,13 +9,15 @@ $| = 1;
 my $show_safe = 0;
 my $show_sophie = 0;
 my $show_twin = 0;
+my $show_usage = 0;
 my $segment_size = 30 * 128_000;   # 128kB
 
 GetOptions( "safe"   => \$show_safe,
             "sophie" => \$show_sophie,
             "twin"   => \$show_twin,
-            "help"   => sub { die_usage() },
+            "help"   => \$show_usage,
           ) || die_usage();
+die_usage() if $show_usage;
 
 # Get the start and end values.  Verify they're positive integers.
 die_usage() unless @ARGV == 2;

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