0.8.3.19:
authorChristophe Rhodes <csr21@cam.ac.uk>
Mon, 1 Sep 2003 12:51:08 +0000 (12:51 +0000)
committerChristophe Rhodes <csr21@cam.ac.uk>
Mon, 1 Sep 2003 12:51:08 +0000 (12:51 +0000)
Fix bug in ROUND/FROUND revealed by PFD
... after cmucl-imp/sbcl-devel 2003-08-xx
Remove last vestiges of *GC-NOTIFY-STREAM*

NEWS
make-target-2.sh
src/code/numbers.lisp
tests/float.pure.lisp
version.lisp-expr

diff --git a/NEWS b/NEWS
index 45ccbdf..8802722 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -2023,6 +2023,10 @@ changes in sbcl-0.8.4 relative to sbcl-0.8.3:
     x86 LEA instruction for multiplication by constants.
   * bug fix: in some situations compiler did not report usage of
     generic arithmetic in (SPEED 3) policy.
+  * fixed some bugs revealed by Paul Dietz' test suite:
+    ** the RETURN clause in LOOP is now equivalent to DO (RETURN ...).
+    ** ROUND and FROUND now give the right answer when given very
+       small float arguments.
 
 planned incompatible changes in 0.8.x:
   * (not done yet, but planned:) When the profiling interface settles
index 507ddf0..fb1c8c1 100644 (file)
@@ -64,9 +64,8 @@ echo //doing warm init
        ;; GC :FULL T isn't nearly as effective as PURIFY here?
        ;; (GC :FULL T gets us down to about 38 Mbytes, but PURIFY
        ;; gets us down to about 19 Mbytes.)
-       (let ((*gc-notify-stream* *standard-output*))
-         (sb-int:/show "done with warm.lisp, about to GC :FULL T")
-         (gc :full t))
+       (sb-int:/show "done with warm.lisp, about to GC :FULL T")
+       (gc :full t)
 
         ;; resetting compilation policy to neutral values in
         ;; preparation for SAVE-LISP-AND-DIE as final SBCL core (not
index a62eb9d..cf807c1 100644 (file)
   (if (eql divisor 1)
       (round number)
       (multiple-value-bind (tru rem) (truncate number divisor)
-       (let ((thresh (/ (abs divisor) 2)))
-         (cond ((or (> rem thresh)
-                    (and (= rem thresh) (oddp tru)))
-                (if (minusp divisor)
-                    (values (- tru 1) (+ rem divisor))
-                    (values (+ tru 1) (- rem divisor))))
-               ((let ((-thresh (- thresh)))
-                  (or (< rem -thresh)
-                      (and (= rem -thresh) (oddp tru))))
-                (if (minusp divisor)
-                    (values (+ tru 1) (- rem divisor))
-                    (values (- tru 1) (+ rem divisor))))
-               (t (values tru rem)))))))
+       (if (zerop rem)
+           (values tru rem)
+           (let ((thresh (/ (abs divisor) 2)))
+             (cond ((or (> rem thresh)
+                        (and (= rem thresh) (oddp tru)))
+                    (if (minusp divisor)
+                        (values (- tru 1) (+ rem divisor))
+                        (values (+ tru 1) (- rem divisor))))
+                   ((let ((-thresh (- thresh)))
+                      (or (< rem -thresh)
+                          (and (= rem -thresh) (oddp tru))))
+                    (if (minusp divisor)
+                        (values (+ tru 1) (- rem divisor))
+                        (values (- tru 1) (+ rem divisor))))
+                   (t (values tru rem))))))))
 
 (defun rem (number divisor)
   #!+sb-doc
index 8ccc63d..dfa417e 100644 (file)
@@ -82,3 +82,6 @@
                               :cl))
            (value (symbol-value name)))
       (assert (zerop (/ value 2))))))
+
+;;; bug found by Paul Dietz: bad rounding on small floats
+(assert (= (fround least-positive-short-float least-positive-short-float) 1.0))
index a1dad1f..be78747 100644 (file)
@@ -17,4 +17,4 @@
 ;;; checkins which aren't released. (And occasionally for internal
 ;;; versions, especially for internal versions off the main CVS
 ;;; branch, it gets hairier, e.g. "0.pre7.14.flaky4.13".)
-"0.8.3.18"
+"0.8.3.19"