X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=src%2Fcode%2Firrat.lisp;h=ef7f6a3c0110033c24da4622e773a81893355bfe;hb=5bad55941fafc315116f6fcf2c8c2cce8af7ed9a;hp=e7131b08af7d56715f8593754095e88d10f16fb9;hpb=7665c62819f24bac3445e7eb5bb3428f48ecb120;p=sbcl.git diff --git a/src/code/irrat.lisp b/src/code/irrat.lisp index e7131b0..ef7f6a3 100644 --- a/src/code/irrat.lisp +++ b/src/code/irrat.lisp @@ -54,6 +54,9 @@ (def-math-rtn "acos" 1) #!-x86 (def-math-rtn "atan" 1) #!-x86 (def-math-rtn "atan2" 2) +#!+x86 ;; for constant folding +(defun %atan2 (x y) + (%atan2 x y)) (def-math-rtn "sinh" 1) (def-math-rtn "cosh" 1) (def-math-rtn "tanh" 1) @@ -118,7 +121,10 @@ #!+sb-doc "Return BASE raised to the POWER." (if (zerop power) - (1+ (* base power)) + (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