Mail Archives: djgpp/2001/06/29/08:38:43
> From: Waldemar Schultz <schultz AT ma DOT tum DOT de>
> Newsgroups: comp.os.msdos.djgpp
> Date: Fri, 29 Jun 2001 11:59:59 +0200
> >
> > For long doubles, the right format for debugging printf's is "%.19g".
> ^^^^ "%.19Lg"
> right?
Yes, I posted a correction.
> > It doesn't; it simply assumes that the format specifier tells the
> > truth. That is, if you say "%f", the corresponding argument is a
> > double, and if you say "%Lf", it's a long double.
> so IMHO the libc info pages about printf/scanf are wrong.
> (at least for DJGPP + gcc)
I don't understand: where's the docs you cited wrong?
If you mean the `printf' docs, then you omitted a crucial part:
* An optional conversion qualifier, which may be `h' to specify
`short', `l' to specify long ints, or `L' to specify long doubles.
Long long type can be specified by `L' or `ll'.
That's why the description of FP formats says
> printf():
> `e'
> `E'
> A floating point number (double or long double).
The `L' qualifier determines whether it's a double or a long double.
- Raw text -