From 7204735ba2d63af4103ba8337c3486a61d9bb7c1 Mon Sep 17 00:00:00 2001 From: rtoy <rtoy> Date: Thu, 22 Apr 2004 15:49:26 +0000 Subject: [PATCH] o Fix typo in output-ratio that was causing incorrect output when *print-radix* was T. If *print-base* were 16, the output would be #xr<...>. o Comment out old float printer routines for now. --- code/print.lisp | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/code/print.lisp b/code/print.lisp index 0889d80ce..c994012ee 100644 --- a/code/print.lisp +++ b/code/print.lisp @@ -5,7 +5,7 @@ ;;; Carnegie Mellon University, and has been placed in the public domain. ;;; (ext:file-comment - "$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/code/print.lisp,v 1.89 2004/04/22 14:38:25 rtoy Exp $") + "$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/code/print.lisp,v 1.90 2004/04/22 15:49:26 rtoy Exp $") ;;; ;;; ********************************************************************** ;;; @@ -1293,8 +1293,8 @@ (2 (write-char #\b stream)) (8 (write-char #\o stream)) (16 (write-char #\x stream)) - (t (write *print-base* :stream stream :radix nil :base 10))) - (write-char #\r stream)) + (t (write *print-base* :stream stream :radix nil :base 10) + (write-char #\r stream)))) (let ((*print-radix* nil)) (output-integer (numerator ratio) stream) (write-char #\/ stream) @@ -1381,6 +1381,7 @@ (defvar *digits* "0123456789") +#+(or) (defun flonum-to-string (x &optional width fdigits scale fmin) (cond ((zerop x) ;;zero is a special case which float-string cannot handle @@ -1400,6 +1401,7 @@ fdigits scale fmin)))))) +#+(or) (defun float-string (fraction exponent precision width fdigits scale fmin) (let ((r fraction) (s 1) (m- 1) (m+ 1) (k 0) (digits 0) (decpnt 0) (cutoff nil) (roundup nil) u low high @@ -1680,8 +1682,9 @@ (defconstant single-float-min-e (nth-value 1 (decode-float least-positive-single-float))) -;;; Implementation of Figure 1 from Burger and Dybvig, 1996. As the -;;; implementation of the Dragon from Classic CMUCL says: "DO NOT EVEN +;;; Implementation of Figure 1 from "Printing Floating-Point Numbers +;;; Quickly and Accurately", by Burger and Dybvig, 1996. As the +;;; implementation of the Dragon algorithm above says: "DO NOT EVEN ;;; THINK OF ATTEMPTING TO UNDERSTAND THIS CODE WITHOUT READING THE ;;; PAPER!" (defun flonum-to-digits (v) -- GitLab