aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJay Belanger2005-05-02 19:41:55 +0000
committerJay Belanger2005-05-02 19:41:55 +0000
commit8f4a8efc4624ecfca5f073e6426088368091c040 (patch)
tree8d6218b13e2687f46789f7cbd5733fd2c1f640ab
parent14e39ad48dd871738ea75ecbecc34636054a9f9d (diff)
downloademacs-8f4a8efc4624ecfca5f073e6426088368091c040.tar.gz
emacs-8f4a8efc4624ecfca5f073e6426088368091c040.zip
(calc-read-number-fancy): Replace string-to-int by string-to-number.
-rw-r--r--lisp/calc/calc-ext.el12
1 files changed, 6 insertions, 6 deletions
diff --git a/lisp/calc/calc-ext.el b/lisp/calc/calc-ext.el
index d4d50d64658..df9f9512aaa 100644
--- a/lisp/calc/calc-ext.el
+++ b/lisp/calc/calc-ext.el
@@ -1,6 +1,6 @@
1;;; calc-ext.el --- various extension functions for Calc 1;;; calc-ext.el --- various extension functions for Calc
2 2
3;; Copyright (C) 1990, 1991, 1992, 1993, 2001, 2002, 2004 Free Software Foundation, Inc. 3;; Copyright (C) 1990, 1991, 1992, 1993, 2001, 2002, 2004, 2005 Free Software Foundation, Inc.
4 4
5;; Author: David Gillespie <daveg@synaptics.com> 5;; Author: David Gillespie <daveg@synaptics.com>
6;; Maintainer: Jay Belanger <belanger@truman.edu> 6;; Maintainer: Jay Belanger <belanger@truman.edu>
@@ -2815,7 +2815,7 @@ calc-kill calc-kill-region calc-yank))))
2815 2815
2816 ;; Integer+fraction with explicit radix 2816 ;; Integer+fraction with explicit radix
2817 ((string-match "^\\([0-9]+\\)\\(#\\|\\^\\^\\)\\([0-9a-zA-Z]*\\)[:/]\\([0-9a-zA-Z]*\\)[:/]\\([0-9a-zA-Z]\\)$" s) 2817 ((string-match "^\\([0-9]+\\)\\(#\\|\\^\\^\\)\\([0-9a-zA-Z]*\\)[:/]\\([0-9a-zA-Z]*\\)[:/]\\([0-9a-zA-Z]\\)$" s)
2818 (let ((radix (string-to-int (math-match-substring s 1))) 2818 (let ((radix (string-to-number (math-match-substring s 1)))
2819 (int (math-match-substring s 3)) 2819 (int (math-match-substring s 3))
2820 (num (math-match-substring s 4)) 2820 (num (math-match-substring s 4))
2821 (den (math-match-substring s 5))) 2821 (den (math-match-substring s 5)))
@@ -2829,7 +2829,7 @@ calc-kill calc-kill-region calc-yank))))
2829 2829
2830 ;; Fraction with explicit radix 2830 ;; Fraction with explicit radix
2831 ((string-match "^\\([0-9]+\\)\\(#\\|\\^\\^\\)\\([0-9a-zA-Z]*\\)[:/]\\([0-9a-zA-Z]*\\)$" s) 2831 ((string-match "^\\([0-9]+\\)\\(#\\|\\^\\^\\)\\([0-9a-zA-Z]*\\)[:/]\\([0-9a-zA-Z]*\\)$" s)
2832 (let ((radix (string-to-int (math-match-substring s 1))) 2832 (let ((radix (string-to-number (math-match-substring s 1)))
2833 (num (math-match-substring s 3)) 2833 (num (math-match-substring s 3))
2834 (den (math-match-substring s 4))) 2834 (den (math-match-substring s 4)))
2835 (let ((num (if (> (length num) 0) (math-read-radix num radix) 1)) 2835 (let ((num (if (> (length num) 0) (math-read-radix num radix) 1))
@@ -2839,7 +2839,7 @@ calc-kill calc-kill-region calc-yank))))
2839 ;; Float with explicit radix and exponent 2839 ;; Float with explicit radix and exponent
2840 ((or (string-match "^0*\\(\\([2-9]\\|1[0-4]\\)\\(#\\|\\^\\^\\)[0-9a-dA-D.]+\\)[eE]\\([-+]?[0-9]+\\)$" s) 2840 ((or (string-match "^0*\\(\\([2-9]\\|1[0-4]\\)\\(#\\|\\^\\^\\)[0-9a-dA-D.]+\\)[eE]\\([-+]?[0-9]+\\)$" s)
2841 (string-match "^\\(\\([0-9]+\\)\\(#\\|\\^\\^\\)[0-9a-zA-Z.]+\\) *\\* *\\2\\.? *\\^ *\\([-+]?[0-9]+\\)$" s)) 2841 (string-match "^\\(\\([0-9]+\\)\\(#\\|\\^\\^\\)[0-9a-zA-Z.]+\\) *\\* *\\2\\.? *\\^ *\\([-+]?[0-9]+\\)$" s))
2842 (let ((radix (string-to-int (math-match-substring s 2))) 2842 (let ((radix (string-to-number (math-match-substring s 2)))
2843 (mant (math-match-substring s 1)) 2843 (mant (math-match-substring s 1))
2844 (exp (math-match-substring s 4))) 2844 (exp (math-match-substring s 4)))
2845 (let ((mant (math-read-number mant)) 2845 (let ((mant (math-read-number mant))
@@ -2849,7 +2849,7 @@ calc-kill calc-kill-region calc-yank))))
2849 2849
2850 ;; Float with explicit radix, no exponent 2850 ;; Float with explicit radix, no exponent
2851 ((string-match "^\\([0-9]+\\)\\(#\\|\\^\\^\\)\\([0-9a-zA-Z]*\\)\\.\\([0-9a-zA-Z]*\\)$" s) 2851 ((string-match "^\\([0-9]+\\)\\(#\\|\\^\\^\\)\\([0-9a-zA-Z]*\\)\\.\\([0-9a-zA-Z]*\\)$" s)
2852 (let ((radix (string-to-int (math-match-substring s 1))) 2852 (let ((radix (string-to-number (math-match-substring s 1)))
2853 (int (math-match-substring s 3)) 2853 (int (math-match-substring s 3))
2854 (fracs (math-match-substring s 4))) 2854 (fracs (math-match-substring s 4)))
2855 (let ((int (if (> (length int) 0) (math-read-radix int radix) 0)) 2855 (let ((int (if (> (length int) 0) (math-read-radix int radix) 0))
@@ -2861,7 +2861,7 @@ calc-kill calc-kill-region calc-yank))))
2861 ;; Integer with explicit radix 2861 ;; Integer with explicit radix
2862 ((string-match "^\\([0-9]+\\)\\(#\\|\\^\\^\\)\\([0-9a-zA-Z]+\\)$" s) 2862 ((string-match "^\\([0-9]+\\)\\(#\\|\\^\\^\\)\\([0-9a-zA-Z]+\\)$" s)
2863 (math-read-radix (math-match-substring s 3) 2863 (math-read-radix (math-match-substring s 3)
2864 (string-to-int (math-match-substring s 1)))) 2864 (string-to-number (math-match-substring s 1))))
2865 2865
2866 ;; C language hexadecimal notation 2866 ;; C language hexadecimal notation
2867 ((and (eq calc-language 'c) 2867 ((and (eq calc-language 'c)