Return-Path: Delivered-To: apmail-stdcxx-dev-archive@www.apache.org Received: (qmail 60832 invoked from network); 12 Mar 2008 18:06:07 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 12 Mar 2008 18:06:07 -0000 Received: (qmail 52232 invoked by uid 500); 12 Mar 2008 18:06:04 -0000 Delivered-To: apmail-stdcxx-dev-archive@stdcxx.apache.org Received: (qmail 52217 invoked by uid 500); 12 Mar 2008 18:06:04 -0000 Mailing-List: contact dev-help@stdcxx.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@stdcxx.apache.org Delivered-To: mailing list dev@stdcxx.apache.org Received: (qmail 52208 invoked by uid 99); 12 Mar 2008 18:06:04 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 12 Mar 2008 11:06:04 -0700 X-ASF-Spam-Status: No, hits=2.6 required=10.0 tests=DNS_FROM_OPENWHOIS,SPF_HELO_PASS,SPF_PASS,WHOIS_MYPRIVREG X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of lists@nabble.com designates 216.139.236.158 as permitted sender) Received: from [216.139.236.158] (HELO kuber.nabble.com) (216.139.236.158) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 12 Mar 2008 18:05:26 +0000 Received: from isper.nabble.com ([192.168.236.156]) by kuber.nabble.com with esmtp (Exim 4.63) (envelope-from ) id 1JZVKa-00009h-B8 for dev@stdcxx.apache.org; Wed, 12 Mar 2008 11:05:36 -0700 Message-ID: <16010982.post@talk.nabble.com> Date: Wed, 12 Mar 2008 11:05:36 -0700 (PDT) From: Martin Sebor To: dev@stdcxx.apache.org Subject: RE: [PATCH] punct.cpp In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Nabble-From: sebor@roguewave.com References: <7BDB2168BEAEF14C98F1901FD2DE643801B84211@epmsa009.minsk.epam.com> <47CF256A.3030709@roguewave.com> X-Virus-Checked: Checked by ClamAV on apache.org Travis Vitek-4 wrote: > > > >>Martin Sebor wrote: >> >>Yes, although it's not immediately obvious to me what the problem >>is, The first assertion above corresponds to this line: >> >> TEST (T, 1.1, 0, 0, 0, ' ', "", "%g"); >> >>I don't see where the test ends up formatting 1.1 as 1.1 using the >>"%g" directive (on AIX, printf("%g", 1.1) produces 1 as expected. >> > > Uh, it most certainly does not. > > You're right, I was looking at the output of %.g. Looks like we need to replace the "%g" with "%.0g" here. Let me take care of that. > > $ cat t.cpp > #include > > int main (int argc, char* argv []) > { > const float f = 1 < argc ? atof (argv [1]) : 1.1; > > printf ("%g\n", f); > printf ("%.0g\n", f); // should be same as %.1g > printf ("%.1g\n", f); > printf ("%.2g\n", f); > printf ("%.3g\n", f); > printf ("%.4g\n", f); > printf ("%.5g\n", f); > printf ("%.6g\n", f); > printf ("%.7g\n", f); > printf ("%.8g\n", f); > printf ("%.9g\n", f); > return 0; > } > > $ xlC t.cpp && a.out 1.1 > 1.1 > 1 > 1 > 1.1 > 1.1 > 1.1 > 1.1 > 1.1 > 1.1 > 1.1 > 1.10000002 > > Travis > > >>Martin >> > > -- View this message in context: http://www.nabble.com/-PATCH--punct.cpp-tp15716394p16010982.html Sent from the stdcxx-dev mailing list archive at Nabble.com.