From 535ca16c7b7c542e0e1313cdb872a1e4b95a28d3 Mon Sep 17 00:00:00 2001 From: rtoy <rtoy> Date: Mon, 15 May 2006 23:56:11 +0000 Subject: [PATCH] Don't produce a continuable error in INTEXP, if we're raising 1 to some power. (Maxima does this sometimes, and it's annoying to have CMUCL stop for this.) --- code/irrat.lisp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/code/irrat.lisp b/code/irrat.lisp index 4c5658c1d..997e04538 100644 --- a/code/irrat.lisp +++ b/code/irrat.lisp @@ -5,7 +5,7 @@ ;;; Carnegie Mellon University, and has been placed in the public domain. ;;; (ext:file-comment - "$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/code/irrat.lisp,v 1.44 2006/05/03 19:39:56 rtoy Exp $") + "$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/code/irrat.lisp,v 1.45 2006/05/15 23:56:11 rtoy Exp $") ;;; ;;; ********************************************************************** ;;; @@ -186,6 +186,12 @@ ;;; of power are calculated as positive integers, and inverted if negative. ;;; (defun intexp (base power) + ;; Handle the special case of 1^power. Maxima sometimes does this, + ;; and there's no need to cause a continuable error in this case. + ;; Should we also handle (-1)^power? + (when (eql base 1) + (return-from intexp base)) + (when (> (abs power) *intexp-maximum-exponent*) (cerror "Continue with calculation." "The absolute value of ~S exceeds ~S." -- GitLab