🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.std.c
Article #533

Re: %g format in printf

#533
From: Bradford R. Daniels
Date: Wed, 06 Sep 1989 19:58
22 lines
1395 bytes
In article <MCGRATH.89Sep5175335@saffron.Berkeley.EDU>,
mcgrath@saffron.Berkeley.EDU (Roland McGrath) writes:
> Yes.  The ANSI standard does specify that the default precision is 6.

Huh?  Where?  I am working from document X3J11/88-159, which says
under %g:

  "The double argument is converted in the style f or e (or in
   style E in the case of a G conversion specifier), with the
   precision specifying the number of digits.  If the precision
   is zero, it is taken as 1.  The style used depends on the
   value converted..."

It then goes on to describe when weach format is used, and that
trailing zeroes, etc. should be removed.  What do you see that I
don't?

- Brad
-----------------------------------------------------------------
Brad Daniels			|  Digital Equipment Corp. almost
DEC Software Devo		|  definitely wouldn't approve of
"VAX C RTL Whipping Boy"	|  anything I say here...
Technical Details
Message-ID: <1441@hiatus.dec.com>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!rutgers!ucsd!ames!apple!sun-barr!decwrl!shlump.nac.dec.com!hiatus.dec.com!grue.dec.com!daniels
References: <MCGRATH.89Sep5175335@saffron.Berkeley.EDU> <1439@hiatus.dec.com>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!rutgers!ucsd!ames!apple!sun-barr!decwrl!shlump.nac.dec.com!hiatus.dec.com!grue.dec.com!daniels
From: daniels@grue.dec.com (Bradford R. Daniels)
Newsgroups: comp.std.c
Subject: Re: %g format in printf
Message-ID: <1441@hiatus.dec.com>
Date: 6 Sep 89 19:58:00 GMT
References: <MCGRATH.89Sep5175335@saffron.Berkeley.EDU> <1439@hiatus.dec.com>
Sender: news@hiatus.dec.com
Organization: Digital Equipment Corporation
Lines: 22