Changeset efbf11a6f5cd7e15f51cdb52fefd1584ab58c3d9

Show
Ignore:
Timestamp:
03/23/12 09:47:16 (2 years ago)
Author:
Raymond Toy <rtoy@…>
Children:
321ced44416bc5141b5306bc18f440eb179c4327
Parents:
bc851c79e6fffe06c4383142bc2dfeb154fbde14
git-committer:
Raymond Toy <rtoy@…> (03/23/12 09:47:16)
Message:

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.

Files:
2 modified

Legend:

Unmodified
Added
Removed
  • qd-methods.lisp

    r06f8a5 refbf11  
    289289 
    290290(declaim (inline float)) 
    291 (defun float (x num-type) 
    292   (qfloat x num-type)) 
     291(defun float (x &optional num-type) 
     292  (qfloat x (or num-type 0.0))) 
    293293 
    294294(defmethod qrealpart ((x number)) 
     
    11121112  +pi+) 
    11131113 
     1114(defmethod float-nan-p ((x cl:float)) 
     1115  ;; CMUCL has ext:float-nan-p.  Should we use that instead? 
     1116  (not (= x x))) 
     1117 
     1118(defmethod float-nan-p ((x qd-real)) 
     1119  (float-nan-p (qd-parts (qd-value x)))) 
     1120 
    11141121 
    11151122(define-condition domain-error (simple-error) 
  • qd-package.lisp

    r6b8dc5 refbf11  
    212212           #:rationalize 
    213213           ) 
     214  #+cmu 
     215  (:shadow ext:float-nan-p) 
    214216  ;; Export types 
    215217  (:export #:qd-real