When compiled with -Wall, int foo (void) { if (9007199254740991.4999999999999999999999999999999995 == 9007199254740991.5) return 1;}
does not complain about a missing return statement, showing that GCC is folding the comparison to true. However, the LHS should round down. With one less 9 GCC gets it correct. I'm not convinced it's worthwhile to get perfect rounding, but Joseph wanted me to file a report. -- Summary: real.c rounding not perfect Product: gcc Version: 4.1.0 Status: UNCONFIRMED Severity: enhancement Priority: P3 Component: c AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: neil at gcc dot gnu dot org CC: gcc-bugs at gcc dot gnu dot org http://gcc.gnu.org/bugzilla/show_bug.cgi?id=21718