¡@

Home 

c++ Programming Glossary: ulps

Floating point comparison revisited

http://stackoverflow.com/questions/13940316/floating-point-comparison-revisited

T bool almostEqual const T a const T b const unsigned ulps 4 Handle NaN. if std isnan a std isnan b return false typedef.. Handle very small and exactly equal values. if std abs a b ulps limits denorm_min return true frexp does the wrong thing for.. is just epsilon 2. return std abs max_frac scaled_min_frac ulps limits epsilon 2 I claim that this code a handles all of the..