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: <01C0DF3C.41B4E5A0@george.wakileh@vol.at> From: "George J. Wakileh" To: "'cygwin AT cygwin DOT com'" Subject: Is this specific to cygwin or gcc? Date: Fri, 18 May 2001 01:45:41 +0200 X-Mailer: Microsoft Internet E-mail/MAPI - 8.0.0.4025 MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Hello, I am using cygwin 1.3.1 with gcc 2.95.3. In the simple c program below, there seems to be a bug in gcc when using floats. There is a factor of 10. I asked a friend in Canada to check this on Borland. She replied she got everything to work fine and the second result is 8.5 not 85.0 as I am getting from cygwin gcc. Any hints as to what is happening? Thanks, George --- main() { double a, b, c; printf("\nEnter a --> "); scanf("%lf", &a); printf("\nEnter b --> "); scanf("%lf", &b); c = (a + b) / 2.; printf("a is %lf,", a); printf(" and b is %lf\n", b); printf("The average is %lf\n", c); } Enter a --> 6 Enter b --> 7 a is 6.000000, and b is 7.000000 The average is 6.500000 Enter a --> 6.5 Enter b --> 8.5 a is 65.000000, and b is 85.000000 The average is 75.000000 -- Want to unsubscribe from this list? Check out: http://cygwin.com/ml/#unsubscribe-simple