I\'m writing a C++ program that doesn\'t work (I get a segmentation fault) when I compile it with optimizations (options -O1, -O2, -O3, etc.), but it works just fine when I
As an experiment, try to see if this will force the compiler to round everything consistently.
volatile float d1=distance(point,p1) ; volatile float d2=distance(point,p2) ; return d1 < d2 ;