This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Reorder the list return of Math::BigInt::Calc::_base_len().
authorNicholas Clark <nick@ccl4.org>
Thu, 28 Oct 2010 13:15:01 +0000 (14:15 +0100)
committerNicholas Clark <nick@ccl4.org>
Fri, 29 Oct 2010 13:42:40 +0000 (14:42 +0100)
A search of CPAN shows that this private function is only used internally
between Math::BigInt::Calc, Math::BigInt::FastCalc and their test suites.

dist/Math-BigInt-FastCalc/FastCalc.pm
dist/Math-BigInt-FastCalc/t/bigintfc.t
dist/Math-BigInt/lib/Math/BigInt/Calc.pm
dist/Math-BigInt/t/bigintc.t
dist/Math-BigInt/t/bigintpm.inc

index 24ab90b..e574655 100644 (file)
@@ -4,11 +4,11 @@ use 5.006;
 use strict;
 use warnings;
 
-use Math::BigInt::Calc;
+use Math::BigInt::Calc 0.56;
 
 use vars qw/$VERSION $BASE $BASE_LEN/;
 
-$VERSION = '0.23';
+$VERSION = '0.24';
 
 require XSLoader;
 XSLoader::load(__PACKAGE__);
@@ -40,11 +40,9 @@ BEGIN
     no strict 'refs';
     *{'Math::BigInt::FastCalc::_' . $method} = \&{'Math::BigInt::Calc::_' . $method};
     }
-  my ($AND_BITS, $XOR_BITS, $OR_BITS, $BASE_LEN_SMALL, $MAX_VAL);
+
   # store BASE_LEN and BASE to later pass it to XS code 
-  ($BASE_LEN, $AND_BITS, $XOR_BITS, $OR_BITS, $BASE_LEN_SMALL, $MAX_VAL, $BASE) =
-    Math::BigInt::Calc::_base_len();
+  ($BASE_LEN, $BASE) = Math::BigInt::Calc::_base_len();
 
   }
 
index 585ec75..a51610c 100644 (file)
@@ -5,7 +5,7 @@ use Test::More tests => 359;
 
 use Math::BigInt::FastCalc;
 
-my ($BASE_LEN, $AND_BITS, $XOR_BITS, $OR_BITS, $BASE_LEN_SMALL, $MAX_VAL) =
+my ($BASE_LEN, undef, $AND_BITS, $XOR_BITS, $OR_BITS, $BASE_LEN_SMALL, $MAX_VAL) =
   Math::BigInt::FastCalc->_base_len();
 
 print "# BASE_LEN = $BASE_LEN\n";
index f3b5156..1fc03d4 100644 (file)
@@ -4,7 +4,7 @@ use 5.006002;
 use strict;
 # use warnings;        # dont use warnings for older Perls
 
-our $VERSION = '0.55';
+our $VERSION = '0.56';
 
 # Package to store unsigned big integers in decimal and do math with them
 
@@ -60,7 +60,7 @@ sub _base_len
       $BASE = int("1e".$BASE_LEN);
       $MAX_VAL = $BASE-1;
       return $BASE_LEN unless wantarray;
-      return ($BASE_LEN, $AND_BITS, $XOR_BITS, $OR_BITS, $BASE_LEN, $MAX_VAL, $BASE);
+      return ($BASE_LEN, $BASE, $AND_BITS, $XOR_BITS, $OR_BITS, $BASE_LEN, $MAX_VAL,);
       }
 
     # find whether we can use mul or div in mul()/div()
@@ -95,7 +95,7 @@ sub _base_len
       }
     }
   return $BASE_LEN unless wantarray;
-  return ($BASE_LEN, $AND_BITS, $XOR_BITS, $OR_BITS, $BASE_LEN, $MAX_VAL, $BASE);
+  return ($BASE_LEN, $BASE, $AND_BITS, $XOR_BITS, $OR_BITS, $BASE_LEN, $MAX_VAL);
   }
 
 sub _new
index a1274f2..9b94aeb 100644 (file)
@@ -5,7 +5,7 @@ use Test::More tests => 375;
 
 use Math::BigInt::Calc;
 
-my ($BASE_LEN, $AND_BITS, $XOR_BITS, $OR_BITS, $BASE_LEN_SMALL, $MAX_VAL) =
+my ($BASE_LEN, undef, $AND_BITS, $XOR_BITS, $OR_BITS, $BASE_LEN_SMALL, $MAX_VAL) =
   Math::BigInt::Calc->_base_len();
 
 print "# BASE_LEN = $BASE_LEN\n";
index 3e80bd3..d28ff54 100644 (file)
@@ -583,7 +583,7 @@ is ($x, 23456);
 
 # construct a number with a zero-hole of BASE_LEN_SMALL
 {
- my @bl = $CL->_base_len(); my $bl = $bl[4];
+ my @bl = $CL->_base_len(); my $bl = $bl[5];
 
  $x = '1' x $bl . '0' x $bl . '1' x $bl . '0' x $bl;
  $y = '1' x (2*$bl);