From: Richard M Kreuter Date: Thu, 21 Aug 2008 15:06:16 +0000 (+0000) Subject: 1.0.19.34: Fix minor bug in TIME. X-Git-Url: http://repo.macrolet.net/gitweb/?a=commitdiff_plain;ds=sidebyside;h=80212db957ccefa9639d33780d6547b7c31ed1e6;p=sbcl.git 1.0.19.34: Fix minor bug in TIME. * Don't print infinitely many zeroes in %FORMAT-DECIMAL when the last several digits of the first argument are zero. Contributed by Bart Botta. --- diff --git a/src/code/time.lisp b/src/code/time.lisp index deda6de..db7829c 100644 --- a/src/code/time.lisp +++ b/src/code/time.lisp @@ -324,18 +324,20 @@ normally during operations like SLEEP." (write-char #\- stream) (setf number (- number))) (let ((scale (expt 10 power))) - (flet ((%fraction (fraction) - (let ((scaled (* 10 fraction))) - (loop while (< scaled scale) - do (write-char #\0 stream) - (setf scaled (* scaled 10)))) - (format stream "~D" fraction)) - (%zeroes () - (let ((scaled (/ scale 10))) - (write-char #\0 stream) - (loop while (> scaled 1) - do (write-char #\0 stream) - (setf scaled (/ scaled 10)))))) + (labels ((%fraction (fraction) + (if (zerop fraction) + (%zeroes) + (let ((scaled (* 10 fraction))) + (loop while (< scaled scale) + do (write-char #\0 stream) + (setf scaled (* scaled 10))))) + (format stream "~D" fraction)) + (%zeroes () + (let ((scaled (/ scale 10))) + (write-char #\0 stream) + (loop while (> scaled 1) + do (write-char #\0 stream) + (setf scaled (/ scaled 10)))))) (cond ((zerop number) (write-string "0." stream) (%zeroes)) diff --git a/version.lisp-expr b/version.lisp-expr index 0a72b8b..5649b43 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".) -"1.0.19.33" +"1.0.19.34"