Commit efbf11a6 by Raymond Toy

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

* Second arg to {{{FLOAT}}} is optional.
* Add {{{FLOAT-NAN-P}}}.

* Need to shadow {{{EXT:FLOAT-NAN-P}}} on cmucl.
parent bc851c79
......@@ -288,8 +288,8 @@
(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))
(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 @@
(:shadow ext:float-nan-p)
;; Export types
(:export #:qd-real
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment