FP and optimization in C

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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

[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux