From cmucl-devel at common-lisp.net Fri Apr 28 16:57:45 2006 From: cmucl-devel at common-lisp.net (cmucl) Date: Fri, 28 Apr 2006 16:57:45 -0000 Subject: [cmucl-ticket] [cmucl] #1: prin1 and ~E produce different outputs. Message-ID: <076.7db2c3e210ca4a70e65ce806121e729d@common-lisp.net> #1: prin1 and ~E produce different outputs. ------------------------+--------------------------------------------------- Reporter: anonymous | Owner: somebody Type: defect | Status: new Priority: minor | Milestone: Component: component1 | Version: Keywords: printing | ------------------------+--------------------------------------------------- (let ((x (random 1d-3))) (values (prin1-to-string x) (format nil "~E" x))) will produce different significant digits. I think the problem is in ~E which calls lisp::scale-exponent to scale the number between 0.1 and 1. I think we could just call flonum-to-digits which will give us the digits and the exponent. We can massage that into the desired digits and exponent as in scale-exponent, but we won't have the round-off problem. Maybe. -- Ticket URL: cmucl cmucl