This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
FP and optimization in C
- From: Ladislav Mecir <lmecir at mbox dot vol dot cz>
- To: gcc-help at gcc dot gnu dot org
- Date: Thu, 08 Dec 2005 09:54:23 +0100
- Subject: FP and optimization in C
Hi all, I have got a following function:
int is_negligible (double a, double b) {
volatile double c = a + b;
return (c - b) == 0.0;
}
Can this be optimized in some way? (I need it to work the same way even
when gcc -O2 is used)
TIA
-Ladislav