diff --git a/float-features.asd b/float-features.asd index c1d9326..a7f63d6 100644 --- a/float-features.asd +++ b/float-features.asd @@ -7,8 +7,9 @@ :homepage "https://github.com/Shinmera/float-features" :serial T :components ((:file "package") + (:file "infinity") (:file "float-features") - (:file "constants") + (:file "nan") (:file "documentation")) :in-order-to ((asdf:test-op (asdf:test-op :float-features-tests))) :depends-on (:trivial-features :documentation-utils)) diff --git a/constants.lisp b/infinity.lisp similarity index 76% rename from constants.lisp rename to infinity.lisp index 2252b16..d629dc7 100644 --- a/constants.lisp +++ b/infinity.lisp @@ -105,40 +105,3 @@ #+lispworks -1L++0 #-(or ccl clasp cmucl ecl mezzano mkcl sbcl lispworks) MOST-NEGATIVE-LONG-FLOAT) - -(handler-case - (progn - (bits-short-float 0) - (defconstant SHORT-FLOAT-NAN - (bits-short-float #b0111111000000000))) - (error () - (define-symbol-macro SHORT-FLOAT-NAN - (bits-short-float #b0111111000000000)))) - -(handler-case - (progn - (bits-single-float 0) - (defconstant SINGLE-FLOAT-NAN - (bits-single-float #b01111111110000000000000000000000))) - (error () - (define-symbol-macro SINGLE-FLOAT-NAN - (bits-single-float #b01111111110000000000000000000000)))) - -(handler-case - (progn - (bits-double-float 0) - (defconstant DOUBLE-FLOAT-NAN - (bits-double-float #b0111111111111000000000000000000000000000000000000000000000000000))) - (error () - (define-symbol-macro DOUBLE-FLOAT-NAN - (bits-double-float #b0111111111111000000000000000000000000000000000000000000000000000)))) - -(handler-case - (progn - (bits-long-float 0) - (defconstant LONG-FLOAT-NAN - (bits-long-float #b01111111111111111000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000))) - (error () - (define-symbol-macro LONG-FLOAT-NAN - (bits-long-float #b01111111111111111000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000)))) - diff --git a/nan.lisp b/nan.lisp new file mode 100644 index 0000000..a179ade --- /dev/null +++ b/nan.lisp @@ -0,0 +1,37 @@ +(in-package #:org.shirakumo.float-features) + +(handler-case + (progn + (bits-short-float 0) + (defconstant SHORT-FLOAT-NAN + (bits-short-float #b0111111000000000))) + (error () + (define-symbol-macro SHORT-FLOAT-NAN + (bits-short-float #b0111111000000000)))) + +(handler-case + (progn + (bits-single-float 0) + (defconstant SINGLE-FLOAT-NAN + (bits-single-float #b01111111110000000000000000000000))) + (error () + (define-symbol-macro SINGLE-FLOAT-NAN + (bits-single-float #b01111111110000000000000000000000)))) + +(handler-case + (progn + (bits-double-float 0) + (defconstant DOUBLE-FLOAT-NAN + (bits-double-float #b0111111111111000000000000000000000000000000000000000000000000000))) + (error () + (define-symbol-macro DOUBLE-FLOAT-NAN + (bits-double-float #b0111111111111000000000000000000000000000000000000000000000000000)))) + +(handler-case + (progn + (bits-long-float 0) + (defconstant LONG-FLOAT-NAN + (bits-long-float #b01111111111111111000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000))) + (error () + (define-symbol-macro LONG-FLOAT-NAN + (bits-long-float #b01111111111111111000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000))))