X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=src%2Fcode%2Firrat.lisp;h=25a5f8b5adf720dcbabe6e16b57e676d415bec83;hb=3fe0010d2777b41e01ea9b4a0f894cfa40f7df1b;hp=e7131b08af7d56715f8593754095e88d10f16fb9;hpb=7665c62819f24bac3445e7eb5bb3428f48ecb120;p=sbcl.git diff --git a/src/code/irrat.lisp b/src/code/irrat.lisp index e7131b0..25a5f8b 100644 --- a/src/code/irrat.lisp +++ b/src/code/irrat.lisp @@ -41,6 +41,18 @@ ) ; EVAL-WHEN +#!+x86 ;; for constant folding +(macrolet ((def (name ll) + `(defun ,name ,ll (,name ,@ll)))) + (def %atan2 (x y)) + (def %atan (x)) + (def %tan-quick (x)) + (def %cos-quick (x)) + (def %sin-quick (x)) + (def %sqrt (x)) + (def %log (x)) + (def %exp (x))) + ;;;; stubs for the Unix math library ;;;; ;;;; Many of these are unnecessary on the X86 because they're built @@ -118,7 +130,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