diff options
| author | Jay Belanger | 2005-07-08 04:32:51 +0000 |
|---|---|---|
| committer | Jay Belanger | 2005-07-08 04:32:51 +0000 |
| commit | 2e2b4fbe92ca08a1502278d8b070b722c68f97df (patch) | |
| tree | ff0042967f1c7b2a29520f2ba4f8e2f326c1487d | |
| parent | c330dafe8a36241879aaefe911ea553ee2b12d99 (diff) | |
| download | emacs-2e2b4fbe92ca08a1502278d8b070b722c68f97df.tar.gz emacs-2e2b4fbe92ca08a1502278d8b070b722c68f97df.zip | |
(math-apply-units): Change the places in which units are simplified.
| -rw-r--r-- | lisp/calc/calc-units.el | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/lisp/calc/calc-units.el b/lisp/calc/calc-units.el index 0983b807fde..3857d930902 100644 --- a/lisp/calc/calc-units.el +++ b/lisp/calc/calc-units.el | |||
| @@ -810,10 +810,10 @@ Entries are (SYMBOL EXPR DOC-STRING TEMP-TYPE BASE-UNITS).") | |||
| 810 | (mapcar 'math-to-standard-rec (cdr expr)))))) | 810 | (mapcar 'math-to-standard-rec (cdr expr)))))) |
| 811 | 811 | ||
| 812 | (defun math-apply-units (expr units ulist &optional pure) | 812 | (defun math-apply-units (expr units ulist &optional pure) |
| 813 | (setq expr (math-simplify-units expr)) | ||
| 813 | (if ulist | 814 | (if ulist |
| 814 | (let ((new 0) | 815 | (let ((new 0) |
| 815 | value) | 816 | value) |
| 816 | (setq expr (math-simplify-units expr)) | ||
| 817 | (or (math-numberp expr) | 817 | (or (math-numberp expr) |
| 818 | (error "Incompatible units")) | 818 | (error "Incompatible units")) |
| 819 | (while (cdr ulist) | 819 | (while (cdr ulist) |
| @@ -826,9 +826,9 @@ Entries are (SYMBOL EXPR DOC-STRING TEMP-TYPE BASE-UNITS).") | |||
| 826 | ulist (cdr ulist))) | 826 | ulist (cdr ulist))) |
| 827 | (math-add new (math-mul (math-div expr (nth 1 (car ulist))) | 827 | (math-add new (math-mul (math-div expr (nth 1 (car ulist))) |
| 828 | (car (car ulist))))) | 828 | (car (car ulist))))) |
| 829 | (math-simplify-units (if pure | 829 | (if pure |
| 830 | expr | 830 | expr |
| 831 | (list '* expr units))))) | 831 | (math-simplify-units (list '* expr units))))) |
| 832 | 832 | ||
| 833 | (defvar math-decompose-units-cache nil) | 833 | (defvar math-decompose-units-cache nil) |
| 834 | (defun math-decompose-units (units) | 834 | (defun math-decompose-units (units) |