News for hackers. Stuff that matters.
Re:GCC optimized code gives strange floating point results by trendia on Sunday February 26, 2017 @02:48PM (#13739375)
Pretty much. If you want to compare two floats a and b within some precision eps, use:

    abs(a - b) <= eps*0.5*(a + b)
or even

    (abs(a - b) <= eps*abs(a)) && (abs(a - b) <= eps*abs(b))
which is implemented in Boost [0].

[0] http://www.boost.org/doc/libs/1_34_0/libs/test/doc/component...

Re:GCC optimized code gives strange floating point results by ratboy666 on Sunday February 26, 2017 @03:33PM (#13739666)
I thought it was

(a / b) != (a / b)