On Sat, 29 Oct 2011, Nikodemus Siivola wrote:
> On 19 August 2011 20:11, Eric Marsden <eric.marsden@...> wrote:
> > ,
> >  * (lispimplementationversion)
> >  "1.0.50.545abf3b4"
> >  * (FORMAT NIL "~E" 1.0)
> >  "1.e+0"
> >  * (FORMAT NIL "~E" 1.0d0)
> >  "1.d+0"
> > `
> >
> > My reading of CLHS ("If all of w, d, and e are omitted, then the effect
> > is to print the value using ordinary freeformat exponentialnotation
> > output") suggests that those should be "1.0e+0" and "1.0d+0".
> >
> > http://www.lispworks.com/documentation/HyperSpec/Body/22_ccb.htm
>
> Thanks! Logged as
>
> https://bugs.launchpad.net/sbcl/+bug/883520
Unless "ordinary" is defined (I cannot find such a definition in the
specification), it is reasonable to understand "ordinary" as the form
without any redundant characters, that is for fixedformat it is "1.0"
(the zero is required since "1." is an integer), but for the
exponential notation "1.e+0" is sufficient (actually, "1.e0" is also
enough, but "+" is explicitly required).
As a hint that "1.e+0" is a better interpretation of Section 22.3.3.2
we can consider
If the parameter d is omitted, then there is no constraint on the
number of digits to appear. A value is chosen for d in such a way
that as many digits as possible may be printed subject to the width
constraint imposed by the parameter w, the constraint of the scale
factor k, and the constraint that no trailing zero digits may appear
in the fraction, except that if the fraction to be printed is zero
then a single zero digit should appear after the decimal point.
and thus "1.0e+0" would violate the "no trailing zero digits"
requirement.

Regards,
ASK
