diff options
author | Paul Eggert <eggert@cs.ucla.edu> | 2019-11-05 13:43:44 -0800 |
---|---|---|
committer | Paul Eggert <eggert@cs.ucla.edu> | 2019-11-05 13:44:02 -0800 |
commit | e5f10c6755f3e1670e4dc59842be72cdf62d3f91 (patch) | |
tree | b755014b028c5497778d671c86019e574004384e /lisp/calculator.el | |
parent | edec35aa9472dca3a80966c62131f00e5288ee49 (diff) | |
download | emacs-e5f10c6755f3e1670e4dc59842be72cdf62d3f91.tar.gz emacs-e5f10c6755f3e1670e4dc59842be72cdf62d3f91.tar.bz2 emacs-e5f10c6755f3e1670e4dc59842be72cdf62d3f91.zip |
Pacify byte-compiler in calculator.el
* lisp/calculator.el (calculator-expt): Open-code cl-evenp to
pacify warning “the function ‘cl-evenp’ might not be defined”.
Problem reported by Juanma Barranquero in:
https://lists.gnu.org/r/emacs-devel/2019-11/msg00118.html
Diffstat (limited to 'lisp/calculator.el')
-rw-r--r-- | lisp/calculator.el | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/lisp/calculator.el b/lisp/calculator.el index fab365d5f28..6c07ee2225d 100644 --- a/lisp/calculator.el +++ b/lisp/calculator.el @@ -1620,7 +1620,9 @@ To use this, apply a binary operator (evaluate it), then call this." (condition-case nil (expt x y) (overflow-error - (if (or (natnump x) (cl-evenp y)) + ;; 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))) 1.0e+INF -1.0e+INF)))) |