The following patch fixes printing of floating point numbers in SBCL.
Specifically, printing did not conform to the following two passages from
CLHS 184.108.40.206.3 - Printing Floats:
- "except that if the format of the number matches that specified by
then the exponent marker E is used."
- "at least one digit after the decimal point."
Here is the test-case for those who want to try this at home:
(assert (string= "1.0E12" (princ-to-string 1.0E12)))
... and the bugfix for sbcl version 1.0.25:
diff src/code/print.lisp.old src/code/print.lisp
< (format stream "e~D" exp))
> (format stream "E~D" exp))
> (when (<= (length string) 1)
> (write-char #\0 stream))
With Best Regards, Christian.