From: Christophe Rhodes Date: Mon, 1 Sep 2003 12:51:08 +0000 (+0000) Subject: 0.8.3.19: X-Git-Url: http://repo.macrolet.net/gitweb/?a=commitdiff_plain;h=eb105cf1d0fdb3769fea9f7a4df29ce82e93189b;p=sbcl.git 0.8.3.19: Fix bug in ROUND/FROUND revealed by PFD ... after cmucl-imp/sbcl-devel 2003-08-xx Remove last vestiges of *GC-NOTIFY-STREAM* --- diff --git a/NEWS b/NEWS index 45ccbdf..8802722 100644 --- 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 diff --git a/make-target-2.sh b/make-target-2.sh index 507ddf0..fb1c8c1 100644 --- a/make-target-2.sh +++ b/make-target-2.sh @@ -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 diff --git a/src/code/numbers.lisp b/src/code/numbers.lisp index a62eb9d..cf807c1 100644 --- a/src/code/numbers.lisp +++ b/src/code/numbers.lisp @@ -654,19 +654,21 @@ (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 diff --git a/tests/float.pure.lisp b/tests/float.pure.lisp index 8ccc63d..dfa417e 100644 --- a/tests/float.pure.lisp +++ b/tests/float.pure.lisp @@ -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)) diff --git a/version.lisp-expr b/version.lisp-expr index a1dad1f..be78747 100644 --- a/version.lisp-expr +++ b/version.lisp-expr @@ -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"