Raymond Toy

Fix bug in FLOAT: second arg is optional! Add FLOAT-NAN-P method.

qd-methods.lisp:
* Second arg to {{{FLOAT}}} is optional.
* Add {{{FLOAT-NAN-P}}}.

qd-package.lisp:
* Need to shadow {{{EXT:FLOAT-NAN-P}}} on cmucl.
......@@ -288,8 +288,8 @@
x)
(declaim (inline float))
(defun float (x num-type)
(qfloat x num-type))
(defun float (x &optional num-type)
(qfloat x (or num-type 0.0)))
(defmethod qrealpart ((x number))
(cl:realpart x))
......@@ -1111,6 +1111,13 @@ the same precision as the argument. The argument can be complex."))
(defmethod float-pi ((z qd-complex))
+pi+)
(defmethod float-nan-p ((x cl:float))
;; CMUCL has ext:float-nan-p. Should we use that instead?
(not (= x x)))
(defmethod float-nan-p ((x qd-real))
(float-nan-p (qd-parts (qd-value x))))
(define-condition domain-error (simple-error)
((function-name :accessor condition-function-name
......
......@@ -211,6 +211,8 @@
#:rational
#:rationalize
)
#+cmu
(:shadow ext:float-nan-p)
;; Export types
(:export #:qd-real
#:qd-complex)
......