(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)
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)