delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2001/01/28/22:46:56

Mailing-List: contact cygwin-help AT sourceware DOT cygnus DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT sources DOT redhat DOT com>
List-Archive: <http://sources.redhat.com/ml/cygwin/>
List-Post: <mailto:cygwin AT sources DOT redhat DOT com>
List-Help: <mailto:cygwin-help AT sources DOT redhat DOT com>, <http://sources.redhat.com/ml/#faqs>
Sender: cygwin-owner AT sources DOT redhat DOT com
Delivered-To: mailing list cygwin AT sources DOT redhat DOT com
X-Authentication-Warning: hp2.xraylith.wisc.edu: khan owned process doing -bs
Date: Sun, 28 Jan 2001 21:46:09 -0600 (CST)
From: Mumit Khan <khan AT NanoTech DOT Wisc DOT EDU>
To: Gerald Jansen <gjansen AT uoguelph DOT ca>
cc: cygwin AT sources DOT redhat DOT com
Subject: Re: cygwin gcc 2.95-2 printf bug
In-Reply-To: <3A746ECA.80D1680E@uoguelph.ca>
Message-ID: <Pine.HPP.3.96.1010128213936.20620Y-100000@hp2.xraylith.wisc.edu>
MIME-Version: 1.0

On Sun, 28 Jan 2001, Gerald Jansen wrote:

> There is a bug printing near-zero floating point numbers in 2.95.2.
> 
> main() {
>   printf("[%5.2f] [%5.2f]\n",0.01,-0.01);
>   printf("[%5.2f] [%5.2f]\n",0.001,-0.001);
>   exit(0);
> }
> 
> Produces:
> [ 0.01] [-0.01]
> [ 0] [-0]

Thanks for reporting it. FYI, It's an issue with newlib (the library 
used in Cygwin), not with gcc.

Unfortunately, I don't have a solution for this ... it also happens
on other newlib supported targets, such as powerpc-eabi using newlib
1.9.0.

For future reference, please include complete code (eg., without the 
missing <stdio.h> include!), and also when you mention "correct result 
on other platforms", please be explicit as to what that correct result 
is. It may be obvious in this particular case, but you'd be amazed how 
many bug reports are never looked at due to ambiguous or insufficient 
information.

Regards,
Mumit



--
Want to unsubscribe from this list?
Check out: http://cygwin.com/ml/#unsubscribe-simple

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019