summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjakub-w <jakub-w@riseup.net>2020-04-16 13:48:03 -0700
committerPaul Eggert <eggert@cs.ucla.edu>2020-04-16 13:55:13 -0700
commit3876a605694b7f3053268e1760b3052f5ac451f4 (patch)
tree6145d87191c50888137608089bf1bdd98a872a21
parent9e832ba91be19071c12bcb6301920b656a919618 (diff)
downloademacs-3876a605694b7f3053268e1760b3052f5ac451f4.tar.gz
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. Copyright-paperwork-exempt: yes
-rw-r--r--lisp/calculator.el2
1 files changed, 1 insertions, 1 deletions
diff --git a/lisp/calculator.el b/lisp/calculator.el
index c1af26ffcc0..6996990814d 100644
--- a/lisp/calculator.el
+++ b/lisp/calculator.el
@@ -1622,7 +1622,7 @@ To use this, apply a binary operator (evaluate it), then call this."
(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))))