Mailing-List: contact cygwin-help AT sourceware DOT cygnus DOT com; run by ezmlm List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT sources DOT redhat DOT com Delivered-To: mailing list cygwin AT sources DOT redhat DOT com Message-Id: From: "Ulrich Jakobus" To: "cygwin AT sourceware DOT cygnus DOT com" Cc: "Johann van Tonder" Date: Wed, 27 Dec 2000 20:55:10 +0200 Reply-To: "Ulrich Jakobus" X-Mailer: PMMail 2000 Professional (2.10.2010) For Windows 2000 (5.0.2195;1) MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Subject: cygwin/newlib bug in printf with %f format Hello, when printing floating point numbers which are very small but not exactly zero using the %f format of printf, then since cygwin-1.1.5-6 (also still in recent cygwin-1.1.7) there is a formatting bug. cygwin-1.1.4 and earlier versions were fine (I did not test versions between 1.1.4 and 1.1.5-6, so I cannot tell precisely since when the problem exists). To illustrate the problem, just compile the following code: --------------------------------------- #include int main() { printf ("%10.3f\n", 0.0); printf ("%10.3f\n", 0.0+1.0e-12); printf ("%10.3f\n", 1.0); printf ("%10.3f\n", 1.0+1.0e-12); } ---------------------------------------- Output of this sample code should be 0.000 0.000 1.000 1.000 but with cygwin1.dll since version 1.1.5-6 it actually is 0.000 0 1.000 1.000 i.e. the second line is too short, the last four characters ".000" are missing (this is very irritating when printing tables, since all output following on the same line is shifted). Could someone please try to identify this problem and fix it? I just guess that it might be in libc/stdio/vfprintf.c but am not sure. Thanks very much and season greetings! Ulrich -- Want to unsubscribe from this list? Check out: http://cygwin.com/ml/#unsubscribe-simple