;;;; support (other than irrational stuff, which is in irrat.) There is
;;;; code in here that assumes there are only two float formats: IEEE
;;;; support (other than irrational stuff, which is in irrat.) There is
;;;; code in here that assumes there are only two float formats: IEEE
;;;; may still remain due to old code which assumes this dichotomy.)
;;;; This software is part of the SBCL system. See the README file for
;;;; may still remain due to old code which assumes this dichotomy.)
;;;; This software is part of the SBCL system. See the README file for
(declare (type bit sign) (type (unsigned-byte 53) sig)
(type (unsigned-byte 11) exp))
(make-double-float (dpb exp sb!vm:double-float-exponent-byte
(declare (type bit sign) (type (unsigned-byte 53) sig)
(type (unsigned-byte 11) exp))
(make-double-float (dpb exp sb!vm:double-float-exponent-byte
;;; We don't want to do these DEFCONSTANTs at cross-compilation time,
;;; because the cross-compilation host might not support floating
;;; We don't want to do these DEFCONSTANTs at cross-compilation time,
;;; because the cross-compilation host might not support floating
-;;; point infinities. Putting them inside a LET remove
-;;; top-level-formness, so that any EVAL-WHEN trickiness in the
+;;; point infinities. Putting them inside a LET removes
+;;; toplevel-formness, so that any EVAL-WHEN trickiness in the
"Return true if the float X is an infinity (+ or -)."
(zerop (ldb sb!vm:single-float-significand-byte bits))
(and (zerop (ldb sb!vm:double-float-significand-byte hi))
"Return true if the float X is an infinity (+ or -)."
(zerop (ldb sb!vm:single-float-significand-byte bits))
(and (zerop (ldb sb!vm:double-float-significand-byte hi))
"Return true if the float X is a NaN (Not a Number)."
(not (zerop (ldb sb!vm:single-float-significand-byte bits)))
(or (not (zerop (ldb sb!vm:double-float-significand-byte hi)))
"Return true if the float X is a NaN (Not a Number)."
(not (zerop (ldb sb!vm:single-float-significand-byte bits)))
(or (not (zerop (ldb sb!vm:double-float-significand-byte hi)))
"Return true if the float X is a trapping NaN (Not a Number)."
(zerop (logand (ldb sb!vm:single-float-significand-byte bits)
sb!vm:single-float-trapping-nan-bit))
"Return true if the float X is a trapping NaN (Not a Number)."
(zerop (logand (ldb sb!vm:single-float-significand-byte bits)
sb!vm:single-float-trapping-nan-bit))
(defun integer-decode-double-denorm (x)
(declare (type double-float x))
(let* ((high-bits (double-float-high-bits (abs x)))
(defun integer-decode-double-denorm (x)
(declare (type double-float x))
(let* ((high-bits (double-float-high-bits (abs x)))
(defun decode-double-denorm (x)
(declare (double-float x))
(multiple-value-bind (sig exp sign) (integer-decode-double-denorm x)
(defun decode-double-denorm (x)
(declare (double-float x))
(multiple-value-bind (sig exp sign) (integer-decode-double-denorm x)