aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lisp/calc/calc.el5
1 files changed, 4 insertions, 1 deletions
diff --git a/lisp/calc/calc.el b/lisp/calc/calc.el
index 922a7c8d7f8..48a1f915aad 100644
--- a/lisp/calc/calc.el
+++ b/lisp/calc/calc.el
@@ -2283,7 +2283,8 @@ See calc-keypad for details."
2283 2283
2284 2284
2285 2285
2286(defconst math-bignum-digit-length 3 2286(defconst math-bignum-digit-length
2287 (truncate (/ (log10 (/ most-positive-fixnum 2)) 2))
2287 "The length of a \"digit\" in Calc bignums. 2288 "The length of a \"digit\" in Calc bignums.
2288If a big integer is of the form (bigpos N0 N1 ...), this is the 2289If a big integer is of the form (bigpos N0 N1 ...), this is the
2289length of the allowable Emacs integers N0, N1,... 2290length of the allowable Emacs integers N0, N1,...
@@ -3466,6 +3467,8 @@ and all digits are kept, regardless of Calc's current precision."
3466 (cond 3467 (cond
3467 ;; Integer 3468 ;; Integer
3468 ((string-match "^[0-9]+$" s) 3469 ((string-match "^[0-9]+$" s)
3470 (if (string-match "^\\(0+\\)" s)
3471 (setq s (substring s (match-end 0))))
3469 (if (<= (length s) (* 2 math-bignum-digit-length)) 3472 (if (<= (length s) (* 2 math-bignum-digit-length))
3470 (string-to-number s) 3473 (string-to-number s)
3471 (cons 'bigpos (math-read-bignum s)))) 3474 (cons 'bigpos (math-read-bignum s))))