emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

master e5f10c6: Pacify byte-compiler in calculator.el


From: Paul Eggert
Subject: master e5f10c6: Pacify byte-compiler in calculator.el
Date: Tue, 5 Nov 2019 16:44:08 -0500 (EST)

branch: master
commit e5f10c6755f3e1670e4dc59842be72cdf62d3f91
Author: Paul Eggert <address@hidden>
Commit: Paul Eggert <address@hidden>

    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
---
 lisp/calculator.el | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/lisp/calculator.el b/lisp/calculator.el
index fab365d..6c07ee2 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))))
 



reply via email to

[Prev in Thread] Current Thread [Next in Thread]