From: Mattias EngdegÄrd Date: Thu, 30 Apr 2020 13:06:06 +0000 (+0200) Subject: Fix calculator division truncation (bug#40892) X-Git-Tag: emacs-28.0.90~7478 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=691f19798a228f3d3cd031b9179311c5cf8394f5;p=emacs.git Fix calculator division truncation (bug#40892) * lisp/calculator.el (calculator-string-to-number): Convert decimal numbers input to float, fixing a regression introduced in f248292ede. Reported by Aitor Soroa. --- diff --git a/lisp/calculator.el b/lisp/calculator.el index 6996990814d..7e0b2fcc6a3 100644 --- a/lisp/calculator.el +++ b/lisp/calculator.el @@ -864,7 +864,7 @@ The result should not exceed the screen width." "\\.\\([^0-9].*\\)?$" ".0\\1" str)) (str (replace-regexp-in-string "[eE][+-]?\\([^0-9].*\\)?$" "e0\\1" str))) - (string-to-number str)))) + (float (string-to-number str))))) (defun calculator-push-curnum () "Push the numeric value of the displayed number to the stack."