Better HN
topnewbestaskshowjobs
Log inSign up

thisisanacc

9 karma · joined Jul 6, 2015 (11y ago) · 1 submissions

Submissions

comment 11y ago · link · parent

    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/