diff options
author | Jay Belanger <jay.p.belanger@gmail.com> | 2005-07-08 04:32:51 +0000 |
---|---|---|
committer | Jay Belanger <jay.p.belanger@gmail.com> | 2005-07-08 04:32:51 +0000 |
commit | 2e2b4fbe92ca08a1502278d8b070b722c68f97df (patch) | |
tree | ff0042967f1c7b2a29520f2ba4f8e2f326c1487d /lisp/calc/calc-units.el | |
parent | c330dafe8a36241879aaefe911ea553ee2b12d99 (diff) | |
download | emacs-2e2b4fbe92ca08a1502278d8b070b722c68f97df.tar.gz |
(math-apply-units): Change the places in which units are simplified.
Diffstat (limited to 'lisp/calc/calc-units.el')
-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).") (mapcar 'math-to-standard-rec (cdr expr)))))) (defun math-apply-units (expr units ulist &optional pure) + (setq expr (math-simplify-units expr)) (if ulist (let ((new 0) value) - (setq expr (math-simplify-units expr)) (or (math-numberp expr) (error "Incompatible units")) (while (cdr ulist) @@ -826,9 +826,9 @@ Entries are (SYMBOL EXPR DOC-STRING TEMP-TYPE BASE-UNITS).") ulist (cdr ulist))) (math-add new (math-mul (math-div expr (nth 1 (car ulist))) (car (car ulist))))) - (math-simplify-units (if pure - expr - (list '* expr units))))) + (if pure + expr + (math-simplify-units (list '* expr units))))) (defvar math-decompose-units-cache nil) (defun math-decompose-units (units) |