Path: utzoo!attcan!utgpu!jarvis.csri.toronto.edu!mailrus!wuarchive!wugate!uunet!crdgw1!crdos1!davidsen
From: davidsen@crdos1.crd.ge.COM (Wm E Davidsen Jr)
Newsgroups: comp.std.c
Subject: Re: %g format in printf
Summary: Significant vs. visible
Message-ID: <272@crdos1.crd.ge.COM>
Date: 6 Sep 89 16:14:42 GMT
References: <1439@hiatus.dec.com>
Reply-To: davidsen@crdos1.UUCP (bill davidsen)
Organization: GE Corp R&D Center
Lines: 16

In article <1439@hiatus.dec.com>, daniels@grue.dec.com (Bradford R. Daniels) writes:

|  Also, the definition of significant digits I learned in my high
|  school science classes says that if I am asked to print out 1024
|  with 1 significant digit, I should get 1000 printed out.  Is that
|  correct?

  I learned the same thing. The term used in K&R 1st ed is "precision,"
and the book states that it is not the same as significance. I once (in
error) wrote a printf in which the %g value did specify significant
digits. I was wrong in my reading of the standard, but it was useful.
-- 
bill davidsen	(davidsen@crdos1.crd.GE.COM -or- uunet!crdgw1!crdos1!davidsen)
"The world is filled with fools. They blindly follow their so-called
'reason' in the face of the church and common sense. Any fool can see
that the world is flat!" - anon