summaryrefslogtreecommitdiff
path: root/lib/bigint.pl
diff options
context:
space:
mode:
Diffstat (limited to 'lib/bigint.pl')
-rw-r--r--lib/bigint.pl6
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/bigint.pl b/lib/bigint.pl
index 45ffe1d402..e6ba644e3b 100644
--- a/lib/bigint.pl
+++ b/lib/bigint.pl
@@ -33,10 +33,14 @@ package bigint;
# bgcd(BINT,BINT) return BINT greatest common divisor
# bnorm(BINT) return BINT normalization
#
+
+$zero = 0;
+
# normalize string form of number. Strip leading zeros. Strip any
# white space and add a sign, if missing.
# Strings that are not numbers result the value 'NaN'.
+
sub main'bnorm { #(num_str) return num_str
local($_) = @_;
s/\s+//g; # strip white space
@@ -263,7 +267,7 @@ sub main'bdiv { #(dividend: num_str, divisor: num_str) return num_str
else {
@d = @x;
}
- (&external($sr, @q), &external($srem, @d, 0));
+ (&external($sr, @q), &external($srem, @d, $zero));
} else {
&external($sr, @q);
}