0.8.21.6:
[sbcl.git] / src / code / irrat.lisp
index e7131b0..ef7f6a3 100644 (file)
@@ -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)
   #!+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