OK, this patch should implement a solution for the problem.
I also added some tests, and incremented the version numbers.
diff -r -u Math-BigInt-1.64.old/lib/Math/BigInt/Calc.pm
Math-BigInt-1.64/lib/Math/BigInt/Calc.pm
--- Math-BigInt-1.64.old/lib/Math/BigInt/Calc.pm Fri Nov 22
07:30:05 2002
+++ Math-BigInt-1.64/lib/Math/BigInt/Calc.pm Fri Nov 22 08:14:18 2002
@@ -8,7 +8,7 @@
use vars qw/@ISA $VERSION/;
@ISA = qw(Exporter);
-$VERSION = '0.34';
+$VERSION = '0.35';
# Package to store unsigned big integers in decimal and do math with them
@@ -1080,7 +1080,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)
+ 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
diff -r -u Math-BigInt-1.64.old/lib/Math/BigInt.pm
Math-BigInt-1.64/lib/Math/BigInt.pm
--- Math-BigInt-1.64.old/lib/Math/BigInt.pm Fri Nov 22 07:30:05 2002
+++ Math-BigInt-1.64/lib/Math/BigInt.pm Fri Nov 22 08:14:03 2002
@@ -18,7 +18,7 @@
my $class = "Math::BigInt";
require 5.005;
-$VERSION = '1.64';
+$VERSION = '1.65';
use Exporter;
@ISA = qw( Exporter );
@EXPORT_OK = qw( objectify _swap bgcd blcm);
Only in Math-BigInt-1.64: pm_to_blib
diff -r -u Math-BigInt-1.64.old/t/bare_mbf.t Math-BigInt-1.64/t/bare_mbf.t
--- Math-BigInt-1.64.old/t/bare_mbf.t Fri Nov 22 07:30:05 2002
+++ Math-BigInt-1.64/t/bare_mbf.t Fri Nov 22 08:10:21 2002
@@ -27,7 +27,7 @@
}
print "# INC = @INC\n";
- plan tests => 1745;
+ plan tests => 1748;
}
use Math::BigFloat lib => 'BareCalc';
diff -r -u Math-BigInt-1.64.old/t/bigfltpm.inc
Math-BigInt-1.64/t/bigfltpm.inc
--- Math-BigInt-1.64.old/t/bigfltpm.inc Fri Nov 22 07:30:05 2002
+++ Math-BigInt-1.64/t/bigfltpm.inc Fri Nov 22 08:07:41 2002
@@ -351,6 +351,7 @@
0.000000001:0
0.0000000001:0
0.00000000001:0
+0.1234567:0
&finf
1:+:inf
2:-:-inf
@@ -1415,6 +1416,7 @@
-51:-51
-51.2:-52
12.2:12
+0.1234567:0
&fceil
0:0
abc:NaN
diff -r -u Math-BigInt-1.64.old/t/bigfltpm.t Math-BigInt-1.64/t/bigfltpm.t
--- Math-BigInt-1.64.old/t/bigfltpm.t Fri Nov 22 07:30:05 2002
+++ Math-BigInt-1.64/t/bigfltpm.t Fri Nov 22 08:09:34 2002
@@ -26,7 +26,7 @@
}
print "# INC = @INC\n";
- plan tests => 1745
+ plan tests => 1748
+ 2; # own tests
}
diff -r -u Math-BigInt-1.64.old/t/sub_mbf.t Math-BigInt-1.64/t/sub_mbf.t
--- Math-BigInt-1.64.old/t/sub_mbf.t Fri Nov 22 07:30:05 2002
+++ Math-BigInt-1.64/t/sub_mbf.t Fri Nov 22 08:11:53 2002
@@ -26,7 +26,7 @@
}
print "# INC = @INC\n";
- plan tests => 1745
+ plan tests => 1748
+ 6; # + our own tests
}
diff -r -u Math-BigInt-1.64.old/t/with_sub.t Math-BigInt-1.64/t/with_sub.t
--- Math-BigInt-1.64.old/t/with_sub.t Fri Nov 22 07:30:05 2002
+++ Math-BigInt-1.64/t/with_sub.t Fri Nov 22 08:13:18 2002
@@ -28,7 +28,7 @@
}
print "# INC = @INC\n";
- plan tests => 1745
+ plan tests => 1748
+ 1;
}