From: Bruno Haible <bruno@cl...> - 2004-09-28 19:28:46
In the tests FORMAT.F.2 FORMAT.F.3, you assume that FORMAT ~F works like WRITE.
CLISP prints 23346.8s0 (exact value is 23346.75) with ~F to "23346.7"
and with WRITE to "23346.8s0" (round-to-even). ANSI CL 184.108.40.206 permits
this: "When rounding up and rounding down would produce printed values
equidistant from the scaled value of arg, then the implementation is free
to use either one."
Could you please fix the tests?
From: Bruno Haible <bruno@cl...> - 2004-10-04 14:25:18
Paul F. Dietz wrote:
> I believe this rounding occurs only when the width or number of trailing
> digits is explicitly limited. When w and d are omitted:
> If both w and d are omitted, then the effect is to print the value
> using ordinary free-format output; prin1 uses this format for any
> number whose magnitude is either zero or between 10^-3 (inclusive)
> and 10^7 (exclusive).
This paragraph says that the format of the output (how many digits, exponent
characters, sign characters etc.) is the same as of PRIN1. It does not say
that the output is the same as with PRIN1. The only text that specifies
the digits is in the first paragraph, and allows rounding in either direction.