X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=src%2Fcode%2Ffloat.lisp;h=4f411f20c275999b44aa73b4e33fc3e53df6f87a;hb=a96369c72588c5457d71d6aaea35f2c450b19ef5;hp=5fa799779f9e75af8fefdc0a62f69e24b2842d40;hpb=82653abf5573c22c691e2243b70647ecdaa6aea8;p=sbcl.git diff --git a/src/code/float.lisp b/src/code/float.lisp index 5fa7997..4f411f2 100644 --- a/src/code/float.lisp +++ b/src/code/float.lisp @@ -34,7 +34,8 @@ (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) @@ -309,15 +310,17 @@ #!+long-float ((long-float) sb!vm:long-float-digits))) -(defun float-radix (x) - #!+sb-doc - "Return (as an integer) the radix b of its floating-point argument." - ;; ANSI says this function "should signal an error if [..] argument - ;; is not a float". Since X is otherwise ignored, Python doesn't - ;; check the type by default, so we have to do it ourself: - (unless (floatp x) - (error 'type-error :datum x :expected-type 'float)) - 2) +(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)) ;;;; INTEGER-DECODE-FLOAT and DECODE-FLOAT