1
0
mirror of https://git.savannah.gnu.org/git/emacs.git synced 2025-01-05 11:45:45 +00:00

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
This commit is contained in:
jakub-w 2020-04-16 13:48:03 -07:00 committed by Paul Eggert
parent 9e832ba91b
commit 3876a60569

View File

@ -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))))