Changeset 12897
- Timestamp:
- Sep 29, 2009, 8:22:23 PM (15 years ago)
- File:
-
- 1 edited
-
trunk/source/lib/numbers.lisp (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/source/lib/numbers.lisp
r10124 r12897 47 47 (ccl:set-fpu-mode :division-by-zero division-by-zero)))) 48 48 49 49 (defconstant double-float-nan 50 #.(let ((invalid (get-fpu-mode :invalid))) 51 (unwind-protect 52 (progn 53 (set-fpu-mode :invalid nil) 54 (+ double-float-positive-infinity double-float-negative-infinity)) 55 (set-fpu-mode :invalid invalid)))) 50 56 51 57 (defun parse-float (str len off) … … 109 115 (nan 110 116 (return-from parse-float 111 (let* ((invalid (ccl:get-fpu-mode :invalid))) 112 (unwind-protect 113 (progn 114 (ccl:set-fpu-mode :invalid nil) 115 (coerce 116 ;; we could also have used a double-float-nan 117 ;; variable binding here: 118 (+ double-float-positive-infinity 119 double-float-positive-infinity) 120 type)) 121 (ccl:set-fpu-mode :invalid invalid))))) 117 (coerce double-float-nan type))) 122 118 (expt (setq expt (%i+ expt (* esign eexp)))) 123 119 (t (return-from parse-float nil)))))
Note:
See TracChangeset
for help on using the changeset viewer.
