From 9acd26cf70decf20240f5485d6f12f4cf22c2a80 Mon Sep 17 00:00:00 2001 From: jakub-w Date: Thu, 16 Apr 2020 22:07:14 +0200 Subject: [PATCH] Fix a typo in calculator.el * lisp/calculator.el (calculator-expt): Overflowing exponentiation caused the function to return -1.0e+INF if the base was an odd, negative number, no matter what the exponent was. --- lisp/calculator.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lisp/calculator.el b/lisp/calculator.el index c1af26ffcc..6996990814 100644 --- a/lisp/calculator.el +++ b/lisp/calculator.el @@ -1622,7 +1622,7 @@ calculator-expt (overflow-error ;; X and Y must be integers, as expt silently returns floating-point ;; infinity on floating-point overflow. - (if (or (natnump x) (zerop (logand x 1))) + (if (or (natnump x) (zerop (logand y 1))) 1.0e+INF -1.0e+INF)))) -- 2.26.1