diff options
| author | Jay Belanger | 2005-05-02 19:45:57 +0000 |
|---|---|---|
| committer | Jay Belanger | 2005-05-02 19:45:57 +0000 |
| commit | 28572d7db775d1ec4b424761887df08b76aca89f (patch) | |
| tree | dda4fc0a2d5a6ca4913766cb8875af89e347ffc5 | |
| parent | ca9cbc3193fc4a8853cbf02b089fdacda4174f78 (diff) | |
| download | emacs-28572d7db775d1ec4b424761887df08b76aca89f.tar.gz emacs-28572d7db775d1ec4b424761887df08b76aca89f.zip | |
(calcDigit-key, math-read-number, math-read-bignum): Replace
string-to-int by string-to-number.
| -rw-r--r-- | lisp/calc/calc.el | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/lisp/calc/calc.el b/lisp/calc/calc.el index ce9681b828f..617fc1ddc89 100644 --- a/lisp/calc/calc.el +++ b/lisp/calc/calc.el | |||
| @@ -2136,7 +2136,7 @@ See calc-keypad for details." | |||
| 2136 | (t | 2136 | (t |
| 2137 | (insert (char-to-string last-command-char)) | 2137 | (insert (char-to-string last-command-char)) |
| 2138 | (if (or (and (calc-minibuffer-contains "[-+]?\\(.*\\+/- *\\|.*mod *\\)?\\([0-9][0-9]?\\)#[0-9a-zA-Z]*\\(:[0-9a-zA-Z]*\\(:[0-9a-zA-Z]*\\)?\\|.[0-9a-zA-Z]*\\(e[-+]?[0-9]*\\)?\\)?\\'") | 2138 | (if (or (and (calc-minibuffer-contains "[-+]?\\(.*\\+/- *\\|.*mod *\\)?\\([0-9][0-9]?\\)#[0-9a-zA-Z]*\\(:[0-9a-zA-Z]*\\(:[0-9a-zA-Z]*\\)?\\|.[0-9a-zA-Z]*\\(e[-+]?[0-9]*\\)?\\)?\\'") |
| 2139 | (let ((radix (string-to-int | 2139 | (let ((radix (string-to-number |
| 2140 | (buffer-substring | 2140 | (buffer-substring |
| 2141 | (match-beginning 2) (match-end 2))))) | 2141 | (match-beginning 2) (match-end 2))))) |
| 2142 | (and (>= radix 2) | 2142 | (and (>= radix 2) |
| @@ -3278,7 +3278,7 @@ See calc-keypad for details." | |||
| 3278 | (eq (aref digs 0) ?0)) | 3278 | (eq (aref digs 0) ?0)) |
| 3279 | (math-read-number (concat "8#" digs)) | 3279 | (math-read-number (concat "8#" digs)) |
| 3280 | (if (<= (length digs) 6) | 3280 | (if (<= (length digs) 6) |
| 3281 | (string-to-int digs) | 3281 | (string-to-number digs) |
| 3282 | (cons 'bigpos (math-read-bignum digs)))))) | 3282 | (cons 'bigpos (math-read-bignum digs)))))) |
| 3283 | 3283 | ||
| 3284 | ;; Clean up the string if necessary | 3284 | ;; Clean up the string if necessary |
| @@ -3315,7 +3315,7 @@ See calc-keypad for details." | |||
| 3315 | (exp (math-match-substring s 2))) | 3315 | (exp (math-match-substring s 2))) |
| 3316 | (let ((mant (if (> (length mant) 0) (math-read-number mant) 1)) | 3316 | (let ((mant (if (> (length mant) 0) (math-read-number mant) 1)) |
| 3317 | (exp (if (<= (length exp) (if (memq (aref exp 0) '(?+ ?-)) 8 7)) | 3317 | (exp (if (<= (length exp) (if (memq (aref exp 0) '(?+ ?-)) 8 7)) |
| 3318 | (string-to-int exp)))) | 3318 | (string-to-number exp)))) |
| 3319 | (and mant exp (Math-realp mant) (> exp -4000000) (< exp 4000000) | 3319 | (and mant exp (Math-realp mant) (> exp -4000000) (< exp 4000000) |
| 3320 | (let ((mant (math-float mant))) | 3320 | (let ((mant (math-float mant))) |
| 3321 | (list 'float (nth 1 mant) (+ (nth 2 mant) exp))))))) | 3321 | (list 'float (nth 1 mant) (+ (nth 2 mant) exp))))))) |
| @@ -3330,9 +3330,9 @@ See calc-keypad for details." | |||
| 3330 | 3330 | ||
| 3331 | (defun math-read-bignum (s) ; [l X] | 3331 | (defun math-read-bignum (s) ; [l X] |
| 3332 | (if (> (length s) 3) | 3332 | (if (> (length s) 3) |
| 3333 | (cons (string-to-int (substring s -3)) | 3333 | (cons (string-to-number (substring s -3)) |
| 3334 | (math-read-bignum (substring s 0 -3))) | 3334 | (math-read-bignum (substring s 0 -3))) |
| 3335 | (list (string-to-int s)))) | 3335 | (list (string-to-number s)))) |
| 3336 | 3336 | ||
| 3337 | 3337 | ||
| 3338 | (defconst math-tex-ignore-words | 3338 | (defconst math-tex-ignore-words |