double subtraction problems

I'm trying to find if double A - double B == 0, but I am having some troubles with the precision (it says it's ~4e-16). What is the best way of compensating for this?
abs(x-y)<epsilon, where epsilon is an appropriately small value. Generally speaking, directly comparing doubles by equality is unreliable.
Haha, yeah, double/float direct comparison will land you in a world of hurt.

Check out this guide that Moschops (I think) dug out a while ago: http://floating-point-gui.de

In particular, you'd want the comparison section.
Topic archived. No new replies allowed.