]> git.eshelyaron.com Git - emacs.git/commitdiff
Fix calculator division truncation (bug#40892)
authorMattias Engdegård <mattiase@acm.org>
Thu, 30 Apr 2020 13:06:06 +0000 (15:06 +0200)
committerMattias Engdegård <mattiase@acm.org>
Thu, 30 Apr 2020 13:24:19 +0000 (15:24 +0200)
* lisp/calculator.el (calculator-string-to-number): Convert decimal
numbers input to float, fixing a regression introduced in f248292ede.
Reported by Aitor Soroa.

lisp/calculator.el

index 6996990814d0b6110f8a5909ee1aba1bccaf350a..7e0b2fcc6a3a876461d43158772a8bb178566529 100644 (file)
@@ -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."