Skip to content
Snippets Groups Projects
Commit 7204735b authored by rtoy's avatar rtoy
Browse files

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.
parent 52168c78
No related branches found
No related tags found
No related merge requests found
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
;;; Carnegie Mellon University, and has been placed in the public domain. ;;; Carnegie Mellon University, and has been placed in the public domain.
;;; ;;;
(ext:file-comment (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 @@ ...@@ -1293,8 +1293,8 @@
(2 (write-char #\b stream)) (2 (write-char #\b stream))
(8 (write-char #\o stream)) (8 (write-char #\o stream))
(16 (write-char #\x stream)) (16 (write-char #\x stream))
(t (write *print-base* :stream stream :radix nil :base 10))) (t (write *print-base* :stream stream :radix nil :base 10)
(write-char #\r stream)) (write-char #\r stream))))
(let ((*print-radix* nil)) (let ((*print-radix* nil))
(output-integer (numerator ratio) stream) (output-integer (numerator ratio) stream)
(write-char #\/ stream) (write-char #\/ stream)
...@@ -1381,6 +1381,7 @@ ...@@ -1381,6 +1381,7 @@
(defvar *digits* "0123456789") (defvar *digits* "0123456789")
#+(or)
(defun flonum-to-string (x &optional width fdigits scale fmin) (defun flonum-to-string (x &optional width fdigits scale fmin)
(cond ((zerop x) (cond ((zerop x)
;;zero is a special case which float-string cannot handle ;;zero is a special case which float-string cannot handle
...@@ -1400,6 +1401,7 @@ ...@@ -1400,6 +1401,7 @@
fdigits scale fmin)))))) fdigits scale fmin))))))
#+(or)
(defun float-string (fraction exponent precision width fdigits scale fmin) (defun float-string (fraction exponent precision width fdigits scale fmin)
(let ((r fraction) (s 1) (m- 1) (m+ 1) (k 0) (let ((r fraction) (s 1) (m- 1) (m+ 1) (k 0)
(digits 0) (decpnt 0) (cutoff nil) (roundup nil) u low high (digits 0) (decpnt 0) (cutoff nil) (roundup nil) u low high
...@@ -1680,8 +1682,9 @@ ...@@ -1680,8 +1682,9 @@
(defconstant single-float-min-e (defconstant single-float-min-e
(nth-value 1 (decode-float least-positive-single-float))) (nth-value 1 (decode-float least-positive-single-float)))
;;; Implementation of Figure 1 from Burger and Dybvig, 1996. As the ;;; Implementation of Figure 1 from "Printing Floating-Point Numbers
;;; implementation of the Dragon from Classic CMUCL says: "DO NOT EVEN ;;; 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 ;;; THINK OF ATTEMPTING TO UNDERSTAND THIS CODE WITHOUT READING THE
;;; PAPER!" ;;; PAPER!"
(defun flonum-to-digits (v) (defun flonum-to-digits (v)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment