emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

master 20c1e7f: Fix calculator division truncation (bug#40892)


From: Glenn Morris
Subject: master 20c1e7f: Fix calculator division truncation (bug#40892)
Date: Sun, 3 May 2020 13:06:23 -0400 (EDT)

branch: master
commit 20c1e7f8af08dadba1d69ff93ca9671cb26cd246
Author: Mattias EngdegÄrd <address@hidden>
Commit: Glenn Morris <address@hidden>

    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.
---
 lisp/calculator.el | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lisp/calculator.el b/lisp/calculator.el
index 6996990..7e0b2fc 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."



reply via email to

[Prev in Thread] Current Thread [Next in Thread]