]> git.eshelyaron.com Git - emacs.git/commitdiff
Pacify byte-compiler in calculator.el
authorPaul Eggert <eggert@cs.ucla.edu>
Tue, 5 Nov 2019 21:43:44 +0000 (13:43 -0800)
committerPaul Eggert <eggert@cs.ucla.edu>
Tue, 5 Nov 2019 21:44:02 +0000 (13:44 -0800)
* 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

lisp/calculator.el

index fab365d5f2841fb4720472fc9aba53462e93d66c..6c07ee2225d11ed4f61305e892b62be69659be6d 100644 (file)
@@ -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))))