This is the mail archive of the cygwin mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

gcc -ansi produces unexpected floating point result


/* This program demonstrates a presumed bug in gcc 3.4.4 shipped
  with cygwin.

If compiled with gcc -mno-cygwin -ansi, it prints:

C:\devel\bwbasic>gcc -mno-cygwin -ansi zatest.c

C:\devel\bwbasic>a
0.000000
2.000000

  Instead of the expected 2.000000 for the first line, and undefined
  for the second line.

Without -ansi it produces a good result.

*/

#include <stdio.h>

int main(void)
{
   double x = 2.0;

   printf("%lf\n", x);
   printf("%f\n", x);
   return (0);
}


-- Problem reports: http://cygwin.com/problems.html FAQ: http://cygwin.com/faq/ Documentation: http://cygwin.com/docs.html Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]