From owner-cvs-src@FreeBSD.ORG Sun Apr 6 18:03:03 2003 Return-Path: Delivered-To: cvs-src@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id F3A9137B401; Sun, 6 Apr 2003 18:03:02 -0700 (PDT) Received: from smtp01.syd.iprimus.net.au (smtp01.syd.iprimus.net.au [210.50.30.52]) by mx1.FreeBSD.org (Postfix) with ESMTP id 5E76843F85; Sun, 6 Apr 2003 18:03:02 -0700 (PDT) (envelope-from tim@robbins.dropbear.id.au) Received: from dilbert.robbins.dropbear.id.au (210.50.251.57) by smtp01.syd.iprimus.net.au (7.0.012) id 3E8A144A00114064; Mon, 7 Apr 2003 11:02:59 +1000 Received: by dilbert.robbins.dropbear.id.au (Postfix, from userid 1000) id E03F7C90D; Mon, 7 Apr 2003 11:03:02 +1000 (EST) Date: Mon, 7 Apr 2003 11:03:02 +1000 From: Tim Robbins To: src-committers@freebsd.org, cvs-src@freebsd.org, cvs-all@freebsd.org Message-ID: <20030407110302.A72014@dilbert.robbins.dropbear.id.au> References: <200304052211.h35MBglG027473@repoman.freebsd.org> <20030406174843.A44495@dilbert.robbins.dropbear.id.au> <20030407004537.GA50755@HAL9000.homeunix.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5.1i In-Reply-To: <20030407004537.GA50755@HAL9000.homeunix.com>; from das@freebsd.org on Sun, Apr 06, 2003 at 05:45:37PM -0700 Subject: Re: cvs commit: src/lib/libc/stdio floatio.h vfprintf.c X-BeenThere: cvs-src@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: CVS commit messages for the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Apr 2003 01:03:03 -0000 On Sun, Apr 06, 2003 at 05:45:37PM -0700, David Schultz wrote: > On Sun, Apr 06, 2003, Tim Robbins wrote: > > On Sat, Apr 05, 2003 at 02:11:42PM -0800, David Schultz wrote: > > > > > das 2003/04/05 14:11:42 PST > > > > > > FreeBSD src repository > > > > > > Modified files: > > > lib/libc/stdio floatio.h vfprintf.c > > > Log: > > > Rework the floating point code in printf(). Significant changes: > > > > > > - We used to round long double arguments to double. Now we print > > > them properly. > > > > > > - Bugs involving '%F', corner cases of '#' and 'g' format > > > specifiers, and the '.*' precision specifier have been > > > fixed. > > > > > > - Added support for the "'" specifier to print thousands' grouping > > > characters in a locale-dependent manner. > > > > > > - Implement the __vfprintf() side of hexadecimal floating point > > > support. All that is still needed is a routine to convert the > > > mantissa to hex digits one nibble at a time in the style of ultoa(). > > > > I think there is a bug here. I've attached a small test program that mimics > > the behaviour of top's "CPU states" display. Here are the results on 4.x: > [...] > > for (i = 0; i < 150; i += 10) > > printf(i >= 100 ? "CPU states: %4.0f%%\n" : > > "CPU states: %4.1f%% user\n", (double)i); > > Oops! I have just checked in a fix for the problem. It was a > little bit tricky due to the handling of thousands' grouping. > Thanks for pointing this out. Thanks. As soon as the p4 depot syncs with CVS again, I'll merge vfprintf.c 1.55 into vfwprintf.c and commit it. I had already merged 1.54, but decided not to commit it until it was fixed. Tim