Date: Mon, 2 Mar 1998 09:51:38 +0200 (IST) From: Eli Zaretskii To: Erik Max Francis cc: djgpp AT delorie DOT com Subject: Re: printf 'g' conversion In-Reply-To: <34FA0CD5.79608BBD@alcyone.com> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Precedence: bulk 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?