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

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

commit 863fed372335e5614589c3bdd0b7f4f00a868668
Author: Dana Jacobsen <d...@acm.org>
Date:   Fri Jun 22 03:09:58 2012 -0600

    Get ready for 0.08 release
---
 Changes                           |  3 +++
 lib/Math/Prime/Util.pm            |  9 ++++++---
 lib/Math/Prime/Util/MemFree.pm    | 13 +++++++++++++
 lib/Math/Prime/Util/PrimeArray.pm |  2 +-
 t/50-factoring.t                  | 31 ++++++++++++++++---------------
 t/51-primearray.t                 |  2 +-
 6 files changed, 40 insertions(+), 20 deletions(-)

diff --git a/Changes b/Changes
index 1dd0b66..e868ba6 100644
--- a/Changes
+++ b/Changes
@@ -9,6 +9,9 @@ Revision history for Perl extension Math::Prime::Util.
       memory, meaning we can skip the 7, 11, and 13 loops.  ~15% speedup.
     - Add all_factors function and added tests to t/50-factoring.t.
     - Add tied array module Math::Prime::Util::PrimeArray.
+    - 5.6.2 64-bit now disables the 64-bit factoring tests instead of failing
+      the module.  The main issue is that we can't verify the factors since 
Perl
+      can't properly multiply them.
 
 0.07  17 June 2012
     - Fixed a bug in next_prime found by Lou Godio (thank you VERY much!).
diff --git a/lib/Math/Prime/Util.pm b/lib/Math/Prime/Util.pm
index e8e8805..bba0070 100644
--- a/lib/Math/Prime/Util.pm
+++ b/lib/Math/Prime/Util.pm
@@ -591,6 +591,7 @@ in place because you still have an object.
 =head2 factor
 
   my @factors = factor(3_369_738_766_071_892_021);
+  # returns (204518747,16476429743)
 
 Produces the prime factors of a positive number input.  They may not be in
 numerical order.  The special cases of C<n = 0> and C<n = 1> will
@@ -736,9 +737,11 @@ not being big number aware.  Assuming a desktop PC, every 
32-bit number
 should be factored by the main routine in a few microseconds, and 64-bit
 numbers should be a few milliseconds at worst.
 
-Perl versions earlier than 5.8.0 have issues with 64-bit.  The test suite will
-try to determine if your Perl is broken.  This will show up in factoring tests.
-Perl 5.6.2 32-bit works fine, as do later versions with 32-bit and 64-bit.
+Perl versions earlier than 5.8.0 have issues with 64-bit that show up in the
+factoring tests.  The test suite will try to determine if your Perl is broken.
+If you use later versions of Perl, or Perl 5.6.2 32-bit, or Perl 5.6.2 64-bit
+and keep numbers below C<~ 2^52>, then everything works.  The best solution is
+to update to a more recent Perl.
 
 The module is thread-safe and should allow good concurrency.
 
diff --git a/lib/Math/Prime/Util/MemFree.pm b/lib/Math/Prime/Util/MemFree.pm
index 052e1dd..7575960 100644
--- a/lib/Math/Prime/Util/MemFree.pm
+++ b/lib/Math/Prime/Util/MemFree.pm
@@ -67,6 +67,19 @@ If you call another function that uses a MemFree object, the 
cache will stay
 in place because you still have an object.
 
 
+=head1 FUNCTIONS
+
+=head2 new
+
+Creates a new auto-free object.  This object has no methods and has no data.
+When it leaves scope it will call C<prime_memfree>, thereby releasing any
+extra memory that the L<Math::Prime::Util> module may have allocated.
+
+Memory is not freed until the last object goes out of scope.  C<prime_memfree>
+may always be called manually.  All memory is freed at C<END> time, so this is
+mainly for long running programs that want extra control over memory use.
+
+
 =head1 AUTHORS
 
 Dana Jacobsen E<lt>d...@acm.orge<gt>
diff --git a/lib/Math/Prime/Util/PrimeArray.pm 
b/lib/Math/Prime/Util/PrimeArray.pm
index cbcd10f..e39e1d0 100644
--- a/lib/Math/Prime/Util/PrimeArray.pm
+++ b/lib/Math/Prime/Util/PrimeArray.pm
@@ -159,7 +159,7 @@ Random access in a small window (1000 or so primes in 
either direction) will
 be very fast, as will sequential access in either direction.
 
 Shifting acts like the array is losing elements at the front, so after two
-shifts, C<$primes[0]> == 5>.  Unshift will move the internal shift index back
+shifts, C<$primes[0] == 5>.  Unshift will move the internal shift index back
 one, unless given an argument which is the number to move back (it silently
 truncates so it does not shift past the beginning).
 Example:
diff --git a/t/50-factoring.t b/t/50-factoring.t
index d6fe13d..7590155 100644
--- a/t/50-factoring.t
+++ b/t/50-factoring.t
@@ -8,6 +8,21 @@ use Math::Prime::Util qw/factor all_factors is_prime/;
 my $use64 = Math::Prime::Util::_maxbits > 32;
 my $extra = defined $ENV{RELEASE_TESTING} && $ENV{RELEASE_TESTING};
 
+
+if ($use64) {
+  # Simple test:  perl -e 'die if 18446744073709550592 == ~0'
+  my $broken = (18446744073709550592 == ~0);
+  if ($broken) {
+    if ($] < 5.008) {
+      diag "Perl pre-5.8.0 has broken 64-bit.  Skipping 64-bit tests.";
+    } else {
+      diag "Eek!  Your 64-bit Perl $] is **** BROKEN ****.  Skipping 64-bit 
tests.";
+    }
+    $use64 = 0;
+  }
+}
+
+
 my @testn = qw/0 1 2 3 4 5 6 7 8 16 57 64 377 9592 30107 78498 664579 5761455
                114256942 2214143 999999929 50847534 455052511 2147483647
                4118054813
@@ -28,7 +43,6 @@ my @testn64 = qw/37607912018 346065536839 600851475143
                  13082761331670030 614889782588491410
                 /;
 
-
 push @testn, @testn64 if $use64;
 
 push @testn, qw/9999986200004761 99999989237606677 999999866000004473/
@@ -58,20 +72,7 @@ my %all_factors = (
       0 => [],
 );
 
-plan tests =>  (2 * scalar @testn) + 1*$use64 + scalar(keys %all_factors) + 
6*7;
-
-if ($use64) {
-  # Simple test:  perl -e 'die if 18446744073709550592 == ~0'
-  my $broken = (18446744073709550592 == ~0);
-  if ($broken) {
-    if ($] < 5.008) {
-      diag "Perl pre-5.8.0 has broken 64-bit.  Expect failures.";
-    } else {
-      diag "Eek!  Your 64-bit Perl $] is **** BROKEN ****.  Expect failures.";
-    }
-  }
-  ok( !$broken, "64-bit isn't obviously broken" );
-}
+plan tests =>  (2 * scalar @testn) + scalar(keys %all_factors) + 6*7;
 
 foreach my $n (@testn) {
   my @f = factor($n);
diff --git a/t/51-primearray.t b/t/51-primearray.t
index 766d519..bacb2f8 100644
--- a/t/51-primearray.t
+++ b/t/51-primearray.t
@@ -56,7 +56,7 @@ my %test_indices = (
 );
   
 
-plan tests => 1 + (3*scalar @small_primes) + 2 + scalar(keys %test_indices) + 
8;
+plan tests => (3*scalar @small_primes) + 2 + scalar(keys %test_indices) + 8;
 
 {
   my @primes;  tie @primes, 'Math::Prime::Util::PrimeArray';

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