Skip to content

Commit

Permalink
Fix a typo in calculator.el
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
jakub-w authored and eggert committed Apr 16, 2020
1 parent 9e832ba commit 3876a60
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lisp/calculator.el
Original file line number Diff line number Diff line change
Expand Up @@ -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))))

Expand Down

0 comments on commit 3876a60

Please sign in to comment.