aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMattias EngdegÄrd2020-04-30 15:06:06 +0200
committerMattias EngdegÄrd2020-04-30 18:10:57 +0200
commit691f19798a228f3d3cd031b9179311c5cf8394f5 (patch)
tree561e50f77c1f8ecaa2b0f819938a446c820abb12
parentd386f1fb6213b2e6746ef9f2ebdde571f8d08124 (diff)
downloademacs-691f19798a228f3d3cd031b9179311c5cf8394f5.tar.gz
emacs-691f19798a228f3d3cd031b9179311c5cf8394f5.zip
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.
-rw-r--r--lisp/calculator.el2
1 files changed, 1 insertions, 1 deletions
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."
864 "\\.\\([^0-9].*\\)?$" ".0\\1" str)) 864 "\\.\\([^0-9].*\\)?$" ".0\\1" str))
865 (str (replace-regexp-in-string 865 (str (replace-regexp-in-string
866 "[eE][+-]?\\([^0-9].*\\)?$" "e0\\1" str))) 866 "[eE][+-]?\\([^0-9].*\\)?$" "e0\\1" str)))
867 (string-to-number str)))) 867 (float (string-to-number str)))))
868 868
869(defun calculator-push-curnum () 869(defun calculator-push-curnum ()
870 "Push the numeric value of the displayed number to the stack." 870 "Push the numeric value of the displayed number to the stack."