-;;;; This file contains the definitions of float specific number
+;;;; This file contains the definitions of float-specific number
;;;; support (other than irrational stuff, which is in irrat.) There is
;;;; code in here that assumes there are only two float formats: IEEE
-;;;; single and double. (Long-float support has been added, but bugs
+;;;; single and double. (LONG-FLOAT support has been added, but bugs
;;;; 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
- (dpb (ash sig -32) sb!vm:double-float-significand-byte
+ (dpb (ash sig -32)
+ sb!vm:double-float-significand-byte
(if (zerop sign) 0 -1)))
(ldb (byte 32 0) sig)))
#!+(and long-float x86)
;;; 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
;;; DEFCONSTANT forms is suppressed.
(let ()
(defconstant single-float-positive-infinity
(and (zerop (ldb sb!vm:long-float-exponent-byte (long-float-exp-bits x)))
(not (zerop x))))))
-(macrolet ((def-frob (name doc single double #!+(and long-float x86) long)
+(macrolet ((def (name doc single double #!+(and long-float x86) long)
`(defun ,name (x)
,doc
(number-dispatch ((x float))
sb!vm:long-float-normal-exponent-max)
,long)))))))
- (def-frob float-infinity-p
+ (def float-infinity-p
"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))
(and (zerop (ldb sb!vm:long-float-significand-byte hi))
(zerop lo)))
- (def-frob float-nan-p
+ (def float-nan-p
"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)))
(or (not (zerop (ldb sb!vm:long-float-significand-byte hi)))
(not (zerop lo))))
- (def-frob float-trapping-nan-p
+ (def float-trapping-nan-p
"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))
(t
(values (logior sig sb!vm:single-float-hidden-bit) biased sign)))))
-;;; Like INTEGER-DECODE-SINGLE-DENORM, only doubly so.
+;;; like INTEGER-DECODE-SINGLE-DENORM, only doubly so
(defun integer-decode-double-denorm (x)
(declare (type double-float x))
(let* ((high-bits (double-float-high-bits (abs x)))
(truly-the fixnum (- biased extra-bias))
sign)))))
-;;; Like INTEGER-DECODE-SINGLE-FLOAT, only doubly so.
+;;; like INTEGER-DECODE-SINGLE-FLOAT, only doubly so
(defun integer-decode-double-float (x)
(declare (double-float x))
(let* ((abs (abs x))
bits))
biased sign)))))
-;;; Like DECODE-SINGLE-DENORM, only doubly so.
+;;; like DECODE-SINGLE-DENORM, only doubly so
(defun decode-double-denorm (x)
(declare (double-float x))
(multiple-value-bind (sig exp sign) (integer-decode-double-denorm x)
(truly-the fixnum (+ exp sb!vm:double-float-digits))
(float sign x))))
-;;; Like DECODE-SINGLE-FLOAT, only doubly so.
+;;; like DECODE-SINGLE-FLOAT, only doubly so
(defun decode-double-float (x)
(declare (double-float x))
(let* ((abs (abs x))