From owner-cvs-all@FreeBSD.ORG Sat Apr 5 23:48:59 2003 Return-Path: Delivered-To: cvs-all@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 9636437B401; Sat, 5 Apr 2003 23:48:59 -0800 (PST) Received: from smtp01.syd.iprimus.net.au (smtp01.syd.iprimus.net.au [210.50.30.52]) by mx1.FreeBSD.org (Postfix) with ESMTP id 03E4143F3F; Sat, 5 Apr 2003 23:48:59 -0800 (PST) (envelope-from tim@robbins.dropbear.id.au) Received: from dilbert.robbins.dropbear.id.au (210.50.88.183) by smtp01.syd.iprimus.net.au (7.0.012) id 3E8A144A000F49DC; Sun, 6 Apr 2003 17:48:57 +1000 Received: by dilbert.robbins.dropbear.id.au (Postfix, from userid 1000) id 336DDC90D; Sun, 6 Apr 2003 17:48:43 +1000 (EST) Date: Sun, 6 Apr 2003 17:48:43 +1000 From: Tim Robbins To: David Schultz Message-ID: <20030406174843.A44495@dilbert.robbins.dropbear.id.au> References: <200304052211.h35MBglG027473@repoman.freebsd.org> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="+QahgC5+KEYLbs62" Content-Disposition: inline User-Agent: Mutt/1.2.5.1i In-Reply-To: <200304052211.h35MBglG027473@repoman.freebsd.org>; from das@FreeBSD.org on Sat, Apr 05, 2003 at 02:11:42PM -0800 cc: cvs-src@FreeBSD.org cc: src-committers@FreeBSD.org cc: cvs-all@FreeBSD.org Subject: Re: cvs commit: src/lib/libc/stdio floatio.h vfprintf.c X-BeenThere: cvs-all@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: CVS commit messages for the entire tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 06 Apr 2003 07:49:00 -0000 --+QahgC5+KEYLbs62 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline 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: CPU states: 0.0% user CPU states: 10.0% user CPU states: 20.0% user CPU states: 30.0% user CPU states: 40.0% user CPU states: 50.0% user CPU states: 60.0% user CPU states: 70.0% user CPU states: 80.0% user CPU states: 90.0% user CPU states: 100% CPU states: 110% CPU states: 120% CPU states: 130% CPU states: 140% Here are the results on -current now: CPU states: 0.0% user CPU states: 10.00% user CPU states: 20.00% user CPU states: 30.00% user CPU states: 40.00% user CPU states: 50.00% user CPU states: 60.00% user CPU states: 70.00% user CPU states: 80.00% user CPU states: 90.00% user CPU states: 10000% CPU states: 1100% CPU states: 1200% CPU states: 1300% CPU states: 1400% If you can't reproduce this problem yourself, it's possible that I've broken something here with all my wide char changes. Tim --+QahgC5+KEYLbs62 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="not-top.c" #include int main(int argc, char *argv[]) { int i; for (i = 0; i < 150; i += 10) printf(i >= 100 ? "CPU states: %4.0f%%\n" : "CPU states: %4.1f%% user\n", (double)i); exit(0); } --+QahgC5+KEYLbs62--