X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=src%2Fcode%2Firrat.lisp;h=71619ee03b61e4124a50e587bb2e13a96ab5b77e;hb=4078d29d83e45a0b059ca5a71877ec36a4174a01;hp=55dbb831a1d2bf5ea1ed8eace0b6125c4f3da7d9;hpb=9510443d0bd00fcbd0213e07a5340e66d9ce7301;p=sbcl.git diff --git a/src/code/irrat.lisp b/src/code/irrat.lisp index 55dbb83..71619ee 100644 --- a/src/code/irrat.lisp +++ b/src/code/irrat.lisp @@ -178,10 +178,15 @@ #!+sb-doc "Return BASE raised to the POWER." (if (zerop power) - (let ((result (1+ (* base power)))) - (if (and (floatp result) (float-nan-p result)) - (float 1 result) - result)) + (if (and (zerop base) (floatp power)) + (error 'arguments-out-of-domain-error + :operands (list base power) + :operation 'expt + :references (list '(:ansi-cl :function expt))) + (let ((result (1+ (* base power)))) + (if (and (floatp result) (float-nan-p result)) + (float 1 result) + result))) (labels (;; determine if the double float is an integer. ;; 0 - not an integer ;; 1 - an odd int