[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
## [Emacs-diffs] /srv/bzr/emacs/trunk r108309: * calc/calc-units.el (math-c

**From**: |
Jay Belanger |

**Subject**: |
[Emacs-diffs] /srv/bzr/emacs/trunk r108309: * calc/calc-units.el (math-consistent-units-p): Accept unit systems |

**Date**: |
Sat, 19 May 2012 09:59:47 -0500 |

**User-agent**: |
Bazaar (2.3.1) |

------------------------------------------------------------
revno: 108309
committer: Jay Belanger <address@hidden>
branch nick: trunk
timestamp: Sat 2012-05-19 09:59:47 -0500
message:
* calc/calc-units.el (math-consistent-units-p): Accept unit systems
as consistent units.
modified:
lisp/calc/calc-units.el

=== modified file 'lisp/calc/calc-units.el'
--- a/lisp/calc/calc-units.el 2012-05-19 03:11:09 +0000
+++ b/lisp/calc/calc-units.el 2012-05-19 14:59:47 +0000
@@ -921,9 +921,12 @@
(math-single-units-in-expr-p (nth 1 expr))))
(t 'wrong)))
-(defun math-consistent-units-p (expr1 expr2)
- "Non-nil if EXPR1 and EXPR2 have consistent units."
- (math-numberp (math-get-units (list '/ expr1 expr2))))
+(defun math-consistent-units-p (expr newunits)
+ "Non-nil if EXPR and NEWUNITS have consistent units."
+ (or
+ (and (eq (car-safe newunits) 'var)
+ (assq (nth 1 newunits) math-standard-units-systems))
+ (math-numberp (math-get-units (list '/ expr newunits)))))
(defun math-check-unit-consistency (expr units)
"Give an error if EXPR and UNITS do not have consistent units."

[Prev in Thread] |
**Current Thread** |
[Next in Thread] |

**[Emacs-diffs] /srv/bzr/emacs/trunk r108309: * calc/calc-units.el (math-consistent-units-p): Accept unit systems**,
*Jay Belanger* **<=**