Mercurial > emacs
diff lisp/calc/calc-units.el @ 91304:c938ab6810a4
Merge from emacs--devo--0
Revision: emacs@sv.gnu.org/emacs--unicode--0--patch-308
author | Miles Bader <miles@gnu.org> |
---|---|
date | Wed, 02 Jan 2008 04:13:39 +0000 |
parents | 4bc33ffdda1a a0abd1e93db8 |
children | 606f2d163a64 |
line wrap: on
line diff
--- a/lisp/calc/calc-units.el Sat Dec 29 02:51:57 2007 +0000 +++ b/lisp/calc/calc-units.el Wed Jan 02 04:13:39 2008 +0000 @@ -491,9 +491,14 @@ (when (eq (car-safe unew) 'error) (error "Bad format in units expression: %s" (nth 2 unew))) (math-put-default-units unew) - (calc-enter-result 1 "cvtm" (math-simplify-units - (math-convert-temperature expr uold unew - uoldname)))))) + (let ((ntemp (calc-normalize + (math-simplify-units + (math-convert-temperature expr uold unew + uoldname))))) + (if (Math-zerop ntemp) + (setq ntemp (list '* ntemp unew))) + (let ((calc-simplify-mode 'none)) + (calc-enter-result 1 "cvtm" ntemp)))))) (defun calc-remove-units () (interactive)