summaryrefslogtreecommitdiff
path: root/lib/Math/BigInt.pm
diff options
context:
space:
mode:
authorGurusamy Sarathy <gsar@cpan.org>1998-05-14 10:53:55 +0000
committerGurusamy Sarathy <gsar@cpan.org>1998-05-14 10:53:55 +0000
commit20408e3ccf502b6ce4033d8203710405ec9ef8f6 (patch)
treeafa7181c847061200a7323363f84fe42102c2aa3 /lib/Math/BigInt.pm
parent9b599b2a63d2324ddacddd9710c41b795a95070d (diff)
downloadperl-20408e3ccf502b6ce4033d8203710405ec9ef8f6.tar.gz
[win32] merge change#896 from maintbranch
p4raw-link: @896 on //depot/maint-5.004/perl: 0562b9ae2b0eff79632fc0164c13c34c06a019e2 p4raw-id: //depot/win32/perl@938
Diffstat (limited to 'lib/Math/BigInt.pm')
-rw-r--r--lib/Math/BigInt.pm6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/Math/BigInt.pm b/lib/Math/BigInt.pm
index 422dca42fd..013e55fadb 100644
--- a/lib/Math/BigInt.pm
+++ b/lib/Math/BigInt.pm
@@ -171,7 +171,7 @@ sub add { #(int_num_array, int_num_array) return int_num_array
$car = 0;
for $x (@x) {
last unless @y || $car;
- $x -= 1e5 if $car = (($x += shift(@y) + $car) >= 1e5) ? 1 : 0;
+ $x -= 1e5 if $car = (($x += (@y ? shift(@y) : 0) + $car) >= 1e5) ? 1 : 0;
}
for $y (@y) {
last unless $car;
@@ -185,8 +185,8 @@ sub sub { #(int_num_array, int_num_array) return int_num_array
local(*sx, *sy) = @_;
$bar = 0;
for $sx (@sx) {
- last unless @y || $bar;
- $sx += 1e5 if $bar = (($sx -= shift(@sy) + $bar) < 0);
+ last unless @sy || $bar;
+ $sx += 1e5 if $bar = (($sx -= (@sy ? shift(@sy) : 0) + $bar) < 0);
}
@sx;
}