summaryrefslogtreecommitdiff
path: root/lisp/calc/calc-units.el
diff options
context:
space:
mode:
authorJay Belanger <jay.p.belanger@gmail.com>2005-07-08 04:32:51 +0000
committerJay Belanger <jay.p.belanger@gmail.com>2005-07-08 04:32:51 +0000
commit2e2b4fbe92ca08a1502278d8b070b722c68f97df (patch)
treeff0042967f1c7b2a29520f2ba4f8e2f326c1487d /lisp/calc/calc-units.el
parentc330dafe8a36241879aaefe911ea553ee2b12d99 (diff)
downloademacs-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.el8
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)