delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2001/06/29/08:38:43

Date: Fri, 29 Jun 2001 13:58:46 +0300
From: "Eli Zaretskii" <eliz AT is DOT elta DOT co DOT il>
Sender: halo1 AT ZAHAV DOT NET DOT IL
To: Waldemar Schultz <schultz AT ma DOT tum DOT de>
Message-Id: <9628-Fri29Jun2001135845+0300-eliz@is.elta.co.il>
X-Mailer: Emacs 20.6 (via feedmail 8.3.emacs20_6 I) and Blat ver 1.8.9
CC: djgpp AT delorie DOT com
In-reply-to: <3B3C519F.C542C834@ma.tum.de> (message from Waldemar Schultz on
Fri, 29 Jun 2001 11:59:59 +0200)
Subject: Re: DJGPP reserves wrong int size
References: <9dde68b7 DOT 0106241053 DOT 2a385311 AT posting DOT google DOT com> <200106242138 DOT RAA18013 AT envy DOT delorie DOT com> <3b37e92e DOT 288745911 AT news DOT primus DOT ca> <200106260242 DOT WAA00615 AT envy DOT delorie DOT com> <3b3b4e40 DOT 213415946 AT news DOT primus DOT ca> <6480-Fri29Jun2001102012+0300-eliz AT is DOT elta DOT co DOT il> <3B3C519F DOT C542C834 AT ma DOT tum DOT de>
Reply-To: djgpp AT delorie DOT com
Errors-To: nobody AT delorie DOT com
X-Mailing-List: djgpp AT delorie DOT com
X-Unsubscribes-To: listserv AT delorie DOT com

> 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 -


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