X-Authentication-Warning: delorie.com: mail set sender to djgpp-bounces using -f X-Trace-PostClient-IP: 68.147.129.203 From: Brian Inglis Newsgroups: comp.os.msdos.djgpp Subject: Re: questions about formatting Organization: Systematic Software Message-ID: References: <200503082119 DOT j28LJN9M020399 AT envy DOT delorie DOT com> X-Newsreader: Forte Agent 1.93/32.576 English (American) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Lines: 35 Date: Wed, 09 Mar 2005 01:04:00 GMT NNTP-Posting-Host: 24.71.223.147 X-Complaints-To: abuse AT shaw DOT ca X-Trace: pd7tw1no 1110330240 24.71.223.147 (Tue, 08 Mar 2005 18:04:00 MST) NNTP-Posting-Date: Tue, 08 Mar 2005 18:04:00 MST To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Reply-To: djgpp AT delorie DOT com On Tue, 08 Mar 2005 22:14:38 GMT in comp.os.msdos.djgpp, "MarioC" wrote: >"DJ Delorie" wrote >> >>> values, the precision field indicates the maximum number of decimal >>> digits printed (for g and G) >> >> Maximum digits. Not maximum digits after the decimal point. > >Thanks for the answer (and for djgpp, by the way)... I was partly >mislead by "the number of fraction digits for a floating point number >(max for g or G, actual for others)" in the online docs that made me >think that g and f differred only marginally with this respect, but I >now see that I got the worst possible choice of a test case... You can download the C99 Standard for US$18 at http://global.ihs.com/doc_detail.cfm?input_doc_number=INCITS%2FISO%2FIEC%209899 and get the definitive description sweated over by the committee: "7.19.6.1 The fprintf function ... #4 ... - An optional precision that gives the minimum number of digits to appear for the d, i, o, u, x, and X conversions, the number of digits to appear after the decimal-point character for a, A, e, E, f, and F conversions, the maximum number of significant digits for the g and G conversions, or the maximum number of bytes to be written for s conversions." -- Thanks. Take care, Brian Inglis Calgary, Alberta, Canada Brian DOT Inglis AT CSi DOT com (Brian[dot]Inglis{at}SystematicSW[dot]ab[dot]ca) fake address use address above to reply