Changeset 12897
 Timestamp:
 Sep 30, 2009, 3:22:23 AM (10 years ago)
 File:

 1 edited
Legend:
 Unmodified
 Added
 Removed

trunk/source/lib/numbers.lisp
r10124 r12897 47 47 (ccl:setfpumode :divisionbyzero divisionbyzero)))) 48 48 49 49 (defconstant doublefloatnan 50 #.(let ((invalid (getfpumode :invalid))) 51 (unwindprotect 52 (progn 53 (setfpumode :invalid nil) 54 (+ doublefloatpositiveinfinity doublefloatnegativeinfinity)) 55 (setfpumode :invalid invalid)))) 50 56 51 57 (defun parsefloat (str len off) … … 109 115 (nan 110 116 (returnfrom parsefloat 111 (let* ((invalid (ccl:getfpumode :invalid))) 112 (unwindprotect 113 (progn 114 (ccl:setfpumode :invalid nil) 115 (coerce 116 ;; we could also have used a doublefloatnan 117 ;; variable binding here: 118 (+ doublefloatpositiveinfinity 119 doublefloatpositiveinfinity) 120 type)) 121 (ccl:setfpumode :invalid invalid))))) 117 (coerce doublefloatnan type))) 122 118 (expt (setq expt (%i+ expt (* esign eexp)))) 123 119 (t (returnfrom parsefloat nil)))))
Note: See TracChangeset
for help on using the changeset viewer.