#12: (format t "~10,1,2,0,'*,,'DE" 1d-6) -> 1.0d-6
--------------------+-------------------------------------------------------
Reporter: rtoy | Owner: somebody
Type: defect | Status: new
Priority: minor | Milestone:
Component: Core | Version: 19d
Keywords: |
--------------------+-------------------------------------------------------
{{{
(format t "~10,1,2,0,'*,,'DE" 1d-6) ->
1.0D-06
}}}
But since the scale factor is 0, the digits should be printed after the
decimal point. The CLHS, sec 22.3.3.2 says:
{{{
If k is zero, then d digits are printed after the decimal point, and a
single zero
digit appears before the decimal point if the total field width will
permit it.
}}}
This works ok for other values:
{{{
(format t "~10,1,2,0,'*,,'DE" 1d-5) ->
0.1D-04
}}}
--
Ticket URL: <http://trac.common-lisp.net/cmucl/ticket/12>
cmucl <http://common-lisp.net/project/cmucl>
cmucl
#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: <http://trac.common-lisp.net/cmucl/ticket/1>
cmucl <http://common-lisp.net/project/cmucl>
cmucl