Change 23216 by [EMAIL PROTECTED] on 2004/08/13 13:18:37

        Subject: [PATCH] pre Math::BigInt v1.72
        From: Tels <[EMAIL PROTECTED]>
        Date: Fri, 13 Aug 2004 14:02:50 +0200
        Message-Id: <[EMAIL PROTECTED]>

Affected files ...

... //depot/perl/lib/Math/BigFloat.pm#58 edit
... //depot/perl/lib/Math/BigInt.pm#66 edit
... //depot/perl/lib/Math/BigInt/Calc.pm#36 edit
... //depot/perl/lib/Math/BigInt/t/bare_mbf.t#17 edit
... //depot/perl/lib/Math/BigInt/t/bigfltpm.inc#24 edit
... //depot/perl/lib/Math/BigInt/t/bigfltpm.t#27 edit
... //depot/perl/lib/Math/BigInt/t/sub_mbf.t#22 edit
... //depot/perl/lib/Math/BigInt/t/with_sub.t#12 edit

Differences ...

==== //depot/perl/lib/Math/BigFloat.pm#58 (text) ====
Index: perl/lib/Math/BigFloat.pm
--- perl/lib/Math/BigFloat.pm#57~23171~ Fri Jul 30 07:24:08 2004
+++ perl/lib/Math/BigFloat.pm   Fri Aug 13 06:18:37 2004
@@ -12,7 +12,7 @@
 #   _a : accuracy
 #   _p : precision
 
-$VERSION = '1.45';
+$VERSION = '1.46';
 require 5.005;
 
 require Exporter;
@@ -745,7 +745,16 @@
     return $x->bnan() if $base->is_zero() || $base->is_one() ||
       $base->{sign} ne '+';
     # if $x == $base, we know the result must be 1.0
-    return $x->bone('+',@params) if $x->bcmp($base) == 0;
+    if ($x->bcmp($base) == 0)
+      {
+      $x->bone('+',@params);
+      if ($fallback)
+        {
+        # clear a/p after round, since user did not request it
+        delete $x->{_a}; delete $x->{_p};
+        }
+      return $x;
+      }
     }
 
   # when user set globals, they would interfere with our calculation, so

==== //depot/perl/lib/Math/BigInt.pm#66 (text) ====
Index: perl/lib/Math/BigInt.pm
--- perl/lib/Math/BigInt.pm#65~23171~   Fri Jul 30 07:24:08 2004
+++ perl/lib/Math/BigInt.pm     Fri Aug 13 06:18:37 2004
@@ -18,7 +18,7 @@
 my $class = "Math::BigInt";
 require 5.005;
 
-$VERSION = '1.71';
+$VERSION = '1.72';
 use Exporter;
 @ISA =       qw( Exporter );
 @EXPORT_OK = qw( objectify bgcd blcm); 

==== //depot/perl/lib/Math/BigInt/Calc.pm#36 (text) ====
Index: perl/lib/Math/BigInt/Calc.pm
--- perl/lib/Math/BigInt/Calc.pm#35~23171~      Fri Jul 30 07:24:08 2004
+++ perl/lib/Math/BigInt/Calc.pm        Fri Aug 13 06:18:37 2004
@@ -6,7 +6,7 @@
 
 use vars qw/$VERSION/;
 
-$VERSION = '0.41';
+$VERSION = '0.42';
 
 # Package to store unsigned big integers in decimal and do math with them
 
@@ -1151,7 +1151,7 @@
   my $dst = 0;                         # destination
   my $src = _num($c,$y);               # as normal int
   my $xlen = (@$x-1)*$BASE_LEN+length(int($x->[-1]));  # len of x in digits
-  if ($src > $xlen or ($src == $xlen and ! defined $x->[1]))
+  if ($src >= $xlen or ($src == $xlen and ! defined $x->[1]))
     {
     # 12345 67890 shifted right by more than 10 digits => 0
     splice (@$x,1);                    # leave only one element

==== //depot/perl/lib/Math/BigInt/t/bare_mbf.t#17 (text) ====
Index: perl/lib/Math/BigInt/t/bare_mbf.t
--- perl/lib/Math/BigInt/t/bare_mbf.t#16~23171~ Fri Jul 30 07:24:08 2004
+++ perl/lib/Math/BigInt/t/bare_mbf.t   Fri Aug 13 06:18:37 2004
@@ -27,7 +27,7 @@
     }
   print "# INC = @INC\n";
 
-  plan tests => 1837;
+  plan tests => 1861;
   }
 
 use Math::BigFloat lib => 'BareCalc';

==== //depot/perl/lib/Math/BigInt/t/bigfltpm.inc#24 (text) ====
Index: perl/lib/Math/BigInt/t/bigfltpm.inc
--- perl/lib/Math/BigInt/t/bigfltpm.inc#23~23171~       Fri Jul 30 07:24:08 2004
+++ perl/lib/Math/BigInt/t/bigfltpm.inc Fri Aug 13 06:18:37 2004
@@ -74,7 +74,7 @@
       } elsif ($f eq "ffac") {
         $try .= "$setup; \$x->ffac();";
       } elsif ($f eq "flog") {
-        if ($args[1] ne '')
+        if (defined $args[1] && $args[1] ne '')
           {
           $try .= "\$y = $class->new($args[1]);";
           $try .= "$setup; \$x->flog(\$y);";
@@ -327,22 +327,22 @@
 1::0
 1:1:0
 1:2:0
-# this is too slow for the testsuite
-#2:0.6931471805599453094172321214581765680755
-#2.718281828:0.9999999998311266953289851340574956564911
-#$div_scale = 20;
-#2.718281828:0.99999999983112669533
-# too slow, too 
-#123:4.8112184355
-$div_scale = 14;
-#10:0:2.302585092994
-#1000:0:6.90775527898214
-#100:0:4.60517018598809
-2::0.69314718055995
-#3.1415:0:1.14470039286086
-# too slow
-#12345:0:9.42100640177928
-#0.001:0:-6.90775527898214
+2::0.6931471805599453094172321214581765680755
+2.718281828::0.9999999998311266953289851340574956564911
+$div_scale = 20;
+2.718281828::0.99999999983112669533
+$div_scale = 15;
+123::4.81218435537242
+10::2.30258509299405
+1000::6.90775527898214
+100::4.60517018598809
+2::0.693147180559945
+3.1415::1.14470039286086
+12345::9.42100640177928
+0.001::-6.90775527898214
+# bug until v1.71:
+10:10:1
+100:100:1
 # reset for further tests
 $div_scale = 40;
 1::0

==== //depot/perl/lib/Math/BigInt/t/bigfltpm.t#27 (xtext) ====
Index: perl/lib/Math/BigInt/t/bigfltpm.t
--- perl/lib/Math/BigInt/t/bigfltpm.t#26~23171~ Fri Jul 30 07:24:08 2004
+++ perl/lib/Math/BigInt/t/bigfltpm.t   Fri Aug 13 06:18:37 2004
@@ -26,7 +26,7 @@
     }
   print "# INC = @INC\n";
 
-  plan tests => 1837
+  plan tests => 1861
        + 2;            # own tests
   }
 

==== //depot/perl/lib/Math/BigInt/t/sub_mbf.t#22 (xtext) ====
Index: perl/lib/Math/BigInt/t/sub_mbf.t
--- perl/lib/Math/BigInt/t/sub_mbf.t#21~23171~  Fri Jul 30 07:24:08 2004
+++ perl/lib/Math/BigInt/t/sub_mbf.t    Fri Aug 13 06:18:37 2004
@@ -26,7 +26,7 @@
     }
   print "# INC = @INC\n"; 
   
-  plan tests => 1837
+  plan tests => 1861
     + 6;       # + our own tests
   }
 

==== //depot/perl/lib/Math/BigInt/t/with_sub.t#12 (text) ====
Index: perl/lib/Math/BigInt/t/with_sub.t
--- perl/lib/Math/BigInt/t/with_sub.t#11~23171~ Fri Jul 30 07:24:08 2004
+++ perl/lib/Math/BigInt/t/with_sub.t   Fri Aug 13 06:18:37 2004
@@ -28,7 +28,7 @@
     }
   print "# INC = @INC\n";
 
-  plan tests => 1837
+  plan tests => 1861
        + 1;
   }
 
End of Patch.

Reply via email to