News for hackers. Stuff that matters.

thisisanacc

Re:Essential facts about floating point calculations on Monday July 06, 2015 @04:08AM (#9837543)

    if( abs(x - y) < 1e-6 ).
Testing for absolute error is often incorrect. Here is a better floating point comparator:

http://floating-point-gui.de/errors/comparison/