Update of /project/cl-store/cvsroot/cl-store/sbcl In directory clnet:/tmp/cvs-serv7536/sbcl
Modified Files: custom.lisp Log Message: Changelog 2006-12-13
--- /project/cl-store/cvsroot/cl-store/sbcl/custom.lisp 2006/03/14 11:02:32 1.12 +++ /project/cl-store/cvsroot/cl-store/sbcl/custom.lisp 2006/12/14 18:15:43 1.13 @@ -4,31 +4,15 @@ (in-package :cl-store)
; special floats -(defvar +single-positive-infinity+ most-positive-single-float) -(defvar +single-negative-infinity+ most-negative-single-float) -(defvar +single-nan+) - -(defvar +double-positive-infinity+ most-positive-double-float) -(defvar +double-negative-infinity+ most-negative-double-float) -(defvar +double-nan+) - -(sb-int:with-float-traps-masked (:overflow :invalid) - (setf +single-positive-infinity+ (expt +single-positive-infinity+ 2)) - (setf +single-negative-infinity+ (expt +single-negative-infinity+ 3)) - (setf +single-nan+ (/ +single-negative-infinity+ +single-negative-infinity+)) - (setf +double-positive-infinity+ (expt +double-positive-infinity+ 2)) - (setf +double-negative-infinity+ (expt +double-negative-infinity+ 3)) - (setf +double-nan+ (/ +double-negative-infinity+ +double-negative-infinity+))) - -(setf *special-floats* - (list (cons +double-positive-infinity+ +positive-double-infinity-code+) - (cons +single-positive-infinity+ +positive-infinity-code+) - (cons +single-negative-infinity+ +negative-infinity-code+) - (cons +double-negative-infinity+ +negative-double-infinity-code+) - (cons +single-nan+ +float-nan-code+) - (cons +double-nan+ +float-double-nan-code+))) - - +(defun create-float-values (value &rest codes) + "Returns a alist of special float to float code mappings." + (sb-int:with-float-traps-masked (:overflow :invalid) + (let ((neg-inf (expt value 3))) + (mapcar 'cons + (list (expt (abs value) 2) + neg-inf + (/ neg-inf neg-inf)) + codes))))
;; Custom structure storing