X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=src%2Fcode%2Fprint.lisp;h=b0a4e72b31441a6dc4a17f10ec1c425a3a120f86;hb=e7b2c507c364da9395ad1f9591210dac44f24afd;hp=a52648ab4a6f572c4a047256972d24715d199d2c;hpb=cc27e35fc73e6765679d6f426ee144abdfac7c27;p=sbcl.git diff --git a/src/code/print.lisp b/src/code/print.lisp index a52648a..b0a4e72 100644 --- a/src/code/print.lisp +++ b/src/code/print.lisp @@ -1333,7 +1333,9 @@ (values-list w)) (t (values-list f)))) (flonum-to-digits x))) - (let ((e (+ e (or scale 0))) + (let ((e (if (zerop x) + e + (+ e (or scale 0)))) (stream (make-string-output-stream))) (if (plusp e) (progn @@ -1351,7 +1353,10 @@ (write-string "." stream) (dotimes (i (- e)) (write-char #\0 stream)) - (write-string string stream) + (write-string string stream :end (when fdigits + (min (length string) + (max (or fmin 0) + (+ fdigits e))))) (when fdigits (dotimes (i (+ fdigits e (- (length string)))) (write-char #\0 stream)))))