delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2005/03/08/20:15:41

X-Authentication-Warning: delorie.com: mail set sender to djgpp-bounces using -f
X-Trace-PostClient-IP: 68.147.129.203
From: Brian Inglis <Brian DOT Inglis AT SystematicSW DOT Invalid>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: questions about formatting
Organization: Systematic Software
Message-ID: <jvhs211bum8jll5r6ae64rle2jttg3vkpe@4ax.com>
References: <knoXd.1026935$35 DOT 38170845 AT news4 DOT tin DOT it> <200503082119 DOT j28LJN9M020399 AT envy DOT delorie DOT com> <itpXd.1027241$35 DOT 38186645 AT news4 DOT tin DOT it>
X-Newsreader: Forte Agent 1.93/32.576 English (American)
MIME-Version: 1.0
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"
<marioc AT no-spam DOT qitech DOT net> wrote:

>"DJ Delorie" <dj AT delorie DOT com> 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

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019