]> code.delx.au - gnu-emacs/blobdiff - lisp/calc/calc-forms.el
(calc-get-operator-history): New variable.
[gnu-emacs] / lisp / calc / calc-forms.el
index 4870891231a8228c3bf71e1c3f77fbaeb9bed53d..7ebbba2aec5d477c9f4117a8cac763b24a6a29c3 100644 (file)
@@ -1,7 +1,7 @@
 ;;; calc-forms.el --- data format conversion functions for Calc
 
-;; Copyright (C) 1990, 1991, 1992, 1993, 2001, 2004, 2005
-;; Free Software Foundation, Inc.
+;; Copyright (C) 1990, 1991, 1992, 1993, 2001, 2002, 2003, 2004,
+;;   2005, 2006 Free Software Foundation, Inc.
 
 ;; Author: David Gillespie <daveg@synaptics.com>
 ;; Maintainer: Jay Belanger <belanger@truman.edu>
@@ -39,9 +39,9 @@
      (calc-enter-result 0 "time"
                        (list 'mod
                              (list 'hms
-                                   (string-to-int (substring time 11 13))
-                                   (string-to-int (substring time 14 16))
-                                   (string-to-int (substring time 17 19)))
+                                   (string-to-number (substring time 11 13))
+                                   (string-to-number (substring time 14 16))
+                                   (string-to-number (substring time 17 19)))
                              (list 'hms 24 0 0))))))
 
 (defun calc-to-hms (arg)
@@ -80,7 +80,7 @@
    (if (equal fmt "")
        (setq fmt "1"))
    (if (string-match "\\` *[0-9] *\\'" fmt)
-       (setq fmt (nth (string-to-int fmt) calc-standard-date-formats)))
+       (setq fmt (nth (string-to-number fmt) calc-standard-date-formats)))
    (or (string-match "[a-zA-Z]" fmt)
        (error "Bad date format specifier"))
    (and arg
 
 
 (defun math-this-year ()
-  (string-to-int (substring (current-time-string) -4)))
+  (string-to-number (substring (current-time-string) -4)))
 
 (defun math-leap-year-p (year)
   (if (Math-lessp year 1752)
          (if (or (string-match "\\([0-9][0-9]?\\):\\([0-9][0-9]?\\)\\(:\\([0-9][0-9]?\\(\\.[0-9]+\\)?\\)\\)? *\\([ap]m?\\|[ap]\\. *m\\.\\|noon\\|n\\>\\|midnight\\|mid\\>\\|m\\>\\)?" math-pd-str)
                  (string-match "\\([0-9][0-9]?\\)\\(\\)\\(\\(\\(\\)\\)\\) *\\([ap]m?\\|[ap]\\. *m\\.\\|noon\\|n\\>\\|midnight\\|mid\\>\\|m\\>\\)" math-pd-str))
              (let ((ampm (math-match-substring math-pd-str 6)))
-               (setq hour (string-to-int (math-match-substring math-pd-str 1))
+               (setq hour (string-to-number (math-match-substring math-pd-str 1))
                      minute (math-match-substring math-pd-str 2)
                      second (math-match-substring math-pd-str 4)
                      math-pd-str (concat (substring math-pd-str 0 (match-beginning 0))
                                  (substring math-pd-str (match-end 0))))
                (if (equal minute "")
                    (setq minute 0)
-                 (setq minute (string-to-int minute)))
+                 (setq minute (string-to-number minute)))
                (if (equal second "")
                    (setq second 0)
                  (setq second (math-read-number second)))
          (setq temp 0)
          (while (string-match "[0-9]+" math-pd-str temp)
            (and c (throw 'syntax "Too many numbers in date"))
-           (setq c (string-to-int (math-match-substring math-pd-str 0)))
+           (setq c (string-to-number (math-match-substring math-pd-str 0)))
            (or b (setq b c c nil))
            (or a (setq a b b nil))
            (setq temp (match-end 0)))
                                  (string-match "\\` *[0-9][0-9][0-9]" math-pd-str)
                                (string-match "\\` *[0-9][0-9]" math-pd-str))
                            (string-match "\\` *[0-9]+" math-pd-str)))
-                    (and (setq num (string-to-int
+                    (and (setq num (string-to-number
                                     (math-match-substring math-pd-str 0))
                                math-pd-str (substring math-pd-str (match-end 0)))
                          nil))
              (setq p (cdr p))))
          (if (looking-at "\\([-+][0-9]?[0-9]\\)\\([0-9][0-9]\\)?\\(\\'\\|[^0-9]\\)")
              (setq offset (math-add
-                           (string-to-int (buffer-substring
+                           (string-to-number (buffer-substring
                                            (match-beginning 1)
                                            (match-end 1)))
                            (if (match-beginning 2)
-                               (math-div (string-to-int (buffer-substring
-                                                         (match-beginning 2)
-                                                         (match-end 2)))
+                               (math-div (string-to-number (buffer-substring
+                                                             (match-beginning 2)
+                                                             (match-end 2)))
                                          60)
                              0)))))
        (if p