From CLHS 22.3.3.2:

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. If k is positive, then it must be strictly less than d+2; k significant digits are printed before the decimal point, and d-k+1 digits are printed after the decimal point. If k is negative, then it must be strictly greater than -d; a single zero digit appears before the decimal point if the total field width will permit it, and after the decimal point are printed first -k zeros and then d+k significant digits.

In `format.e.20`

, the format string is `"~,2,,4E"`

: `d`

is 2 and `k`

is 4, but `k`

(4) is not strictly less than `d+2`

(4).

From CLHS 22.3.3.2:

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.

In `format.e.6`

, the format string `"~6E"`

omits the `d`

parameter, and there is room for `"1.0e+0"`

in an output of size 6. I can't see why the terminal 0 should not be printed. (See also this sbcl bug report)