diff options
Diffstat (limited to 'lisp')
| -rw-r--r-- | lisp/calc/calc-units.el | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/lisp/calc/calc-units.el b/lisp/calc/calc-units.el index 6d876cf79ba..e5c7b6737fb 100644 --- a/lisp/calc/calc-units.el +++ b/lisp/calc/calc-units.el | |||
| @@ -921,9 +921,12 @@ If EXPR is nil, return nil." | |||
| 921 | (math-single-units-in-expr-p (nth 1 expr)))) | 921 | (math-single-units-in-expr-p (nth 1 expr)))) |
| 922 | (t 'wrong))) | 922 | (t 'wrong))) |
| 923 | 923 | ||
| 924 | (defun math-consistent-units-p (expr1 expr2) | 924 | (defun math-consistent-units-p (expr newunits) |
| 925 | "Non-nil if EXPR1 and EXPR2 have consistent units." | 925 | "Non-nil if EXPR and NEWUNITS have consistent units." |
| 926 | (math-numberp (math-get-units (list '/ expr1 expr2)))) | 926 | (or |
| 927 | (and (eq (car-safe newunits) 'var) | ||
| 928 | (assq (nth 1 newunits) math-standard-units-systems)) | ||
| 929 | (math-numberp (math-get-units (list '/ expr newunits))))) | ||
| 927 | 930 | ||
| 928 | (defun math-check-unit-consistency (expr units) | 931 | (defun math-check-unit-consistency (expr units) |
| 929 | "Give an error if EXPR and UNITS do not have consistent units." | 932 | "Give an error if EXPR and UNITS do not have consistent units." |