(make-long-float (logior (ash sign 15) exp)
(ldb (byte 32 32) sig)
(ldb (byte 32 0) sig)))
-
+
) ; EVAL-WHEN
\f
;;;; float parameters
(defconstant least-negative-short-float least-negative-single-float)
(defconstant least-positive-double-float (double-from-bits 0 0 1))
#!-long-float
-(defconstant least-positive-long-float least-positive-double-float)
+(defconstant least-positive-long-float (double-from-bits 0 0 1))
#!+(and long-float x86)
(defconstant least-positive-long-float (long-from-bits 0 0 1))
(defconstant least-negative-double-float (double-from-bits 1 0 1))
#!-long-float
-(defconstant least-negative-long-float least-negative-double-float)
+(defconstant least-negative-long-float (double-from-bits 1 0 1))
#!+(and long-float x86)
(defconstant least-negative-long-float (long-from-bits 1 0 1))
(defun float-sign (float1 &optional (float2 (float 1 float1)))
#!+sb-doc
"Return a floating-point number that has the same sign as
- float1 and, if float2 is given, has the same absolute value
- as float2."
+ FLOAT1 and, if FLOAT2 is given, has the same absolute value
+ as FLOAT2."
(declare (float float1 float2))
(* (if (etypecase float1
(single-float (minusp (single-float-bits float1)))
#!+long-float
((long-float) sb!vm:long-float-digits)))
-(setf (fdefinition 'float-radix)
- ;; FIXME: Python flushes unused variable X in CLAMBDA, then
- ;; flushes unused reference to X in XEP together with type
- ;; check. When this is fixed, rewrite this definition in an
- ;; ordinary form. -- APD, 2002-10-21
- (lambda (x)
- #!+sb-doc
- "Return (as an integer) the radix b of its floating-point argument."
- (unless (floatp x)
- (error 'type-error :datum x :expected-type 'float))
- 2))
+(defun float-radix (x)
+ #!+sb-doc
+ "Return (as an integer) the radix b of its floating-point argument."
+ (declare (ignore x))
+ 2)
\f
;;;; INTEGER-DECODE-FLOAT and DECODE-FLOAT