Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

consolidate float boundary constants

  • Loading branch information...
commit 7a6ad1441ae3da89eed9fcaf91ee443eee041d67 1 parent 56d42db
@lisp authored
Showing with 2 additions and 78 deletions.
  1. +2 −0  package.lisp
  2. +0 −78 parameters.lisp
View
2  package.lisp
@@ -661,6 +661,7 @@
:double-float-nan ; variable
:double-float-negative-infinity ; variable
:double-float-positive-infinity ; variable
+ :double-float-nan ; variable
:dtx-channel ; function
:encode-method ; function
:enqueue
@@ -732,6 +733,7 @@
:simple-stream ; class
:single-float-nan ; variable
:single-float-negative-infinity ; variable
+ :single-float-nan ; variable
:single-float-positive-infinity ; variable
:stream-advance-to-column ; function
:stream-buffer ; function
View
78 parameters.lisp
@@ -80,81 +80,3 @@
(def-mime-type-key :sexp :if-does-not-exist :create)
(def-mime-type (:application :sexp))
-;;;
-;;; constants and parameters used for codec operators
-;;;
-;;; floating point boundary constants
-;;; define them where an implementation has not prepared them
-;;;
-;;; extended from corkill's openmcl addition
-
-#+mcl
-(unless (boundp 'double-float-positive-infinity)
- (eval-when (:compile-toplevel :load-toplevel :execute)
- (defconstant double-float-positive-infinity
- (unwind-protect
- (progn
- (ccl::set-fpu-mode :division-by-zero nil)
- (funcall '/ 0d0))
- (ccl::set-fpu-mode :division-by-zero t)))
-
- (defconstant double-float-negative-infinity
- (unwind-protect
- (progn
- (ccl::set-fpu-mode :division-by-zero nil)
- (funcall '/ -0d0))
- (ccl::set-fpu-mode :division-by-zero t)))))
-
-#+(or mcl (and clozure (not ccl-1.4)))
-(unless (boundp 'double-float-nan)
- (defconstant double-float-nan
- (unwind-protect
- (locally (declare (special double-float-positive-infinity double-float-negative-infinity))
- (ccl::set-fpu-mode :invalid nil)
- (funcall '+ double-float-positive-infinity double-float-negative-infinity))
- (ccl::set-fpu-mode :invalid t))))
-
-#+(or mcl clozure)
-(unless (boundp 'single-float-positive-infinity)
- (eval-when (:compile-toplevel :load-toplevel :execute)
- (defconstant single-float-positive-infinity
- (unwind-protect
- (progn
- (ccl::set-fpu-mode :division-by-zero nil)
- (funcall '/ 0s0))
- (ccl::set-fpu-mode :division-by-zero t)))
-
- (defconstant single-float-negative-infinity
- (unwind-protect
- (progn
- (ccl::set-fpu-mode :division-by-zero nil)
- (funcall '/ -0s0))
- (ccl::set-fpu-mode :division-by-zero t)))))
-
-#+(or mcl clozure)
-(unless (boundp 'single-float-nan)
- (defconstant single-float-nan
- (unwind-protect
- (locally (declare (special single-float-positive-infinity single-float-negative-infinity))
- (ccl::set-fpu-mode :invalid nil)
- (funcall '+ single-float-positive-infinity single-float-negative-infinity))
- (ccl::set-fpu-mode :invalid t))))
-
-#+sbcl ;; works on osx and linux
-(unless (boundp 'single-float-nan)
- (sb-vm::with-float-traps-masked (:invalid)
- (defconstant single-float-nan
- (eval '(+ single-float-positive-infinity single-float-negative-infinity)))
- (defconstant double-float-nan
- (eval '(+ double-float-positive-infinity double-float-negative-infinity)))))
-
-#+lispworks
-(progn
- (defconstant double-float-positive-infinity system::*plus-infinity-double*)
- (defconstant double-float-negative-infinity system::*minus-infinity-double*)
- (defconstant single-float-positive-infinity (coerce system::*plus-infinity-double* 'single-float))
- (defconstant single-float-negative-infinity (coerce system::*minus-infinity-double* 'single-float))
-
- (defconstant single-float-nan (+ single-float-positive-infinity single-float-negative-infinity))
- (defconstant double-float-nan (+ double-float-positive-infinity double-float-negative-infinity))
- )
Please sign in to comment.
Something went wrong with that request. Please try again.