Mail Archives: djgpp/2005/03/08/20:15:41
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 -