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 X-Apparently-From: Message-ID: <3B04664A.4EF679E9@yahoo.com> Date: Thu, 17 May 2001 20:01:14 -0400 From: Earnie Boyd X-Mailer: Mozilla 4.76 [en] (WinNT; U) X-Accept-Language: en MIME-Version: 1.0 To: "George J. Wakileh" CC: "'cygwin AT cygwin DOT com'" Subject: Re: Is this specific to cygwin or gcc? References: <01C0DF3C DOT 41B4E5A0 AT george DOT wakileh@vol.at> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit "George J. Wakileh" wrote: > > 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 > http://www.google.com/search?hl=en&lr=&safe=off&q=float+2001+site%3Acygwin.com -- Earnie. _________________________________________________________ Do You Yahoo!? Get your free @yahoo.com address at http://mail.yahoo.com -- Want to unsubscribe from this list? Check out: http://cygwin.com/ml/#unsubscribe-simple