Mail Archives: djgpp/1998/03/02/02:52:23
On Sun, 1 Mar 1998, Erik Max Francis wrote:
> Why not look at the _actual_ ANSI document? From ANSI 7.9.6.1:
>
> The double argument is converted in style f or e (or in style E in
> the case of a G conversion specifier), with the precision specifying
> the number of significant digits. If the precision is zero, it is
> taken as 1.
Sorry, I must be too dense today ;-). I *did* read the Standard
before posting. It says (in a fragment you didn't quote) that when
the `e' style would result in a sufficiently small exponent, `f' style
should be used. This is all okay, and DJGPP's libc does just that: it
prints a number like if you said "%11.9f".
What is unclear to me is whether using %11.9f for %9.9g is correct
when the former produces leading zeros, like in "0.012345679", since
these leading zeos are not, strictly speaking, significant digits. I
couldn't see anything in the Standard that clarifies this. Can you?
- Raw text -