Dear All,
I want to do two mathematical operations, say
a / b
and
c / d
then test whether they are equal. I'm really very bad at computer errors, I think I need to read more about it (any reference is welcome). So, my question is: What is a suitable EPSILON to tolerate some computational errors in general? I know this depends on the complexity of the operation itself (because of propagating the errors at different steps of computation)... but what is a suitable start?
bool equals(double n1, double n2)
{
return ((n1 - n2 <= EPSILON) || (n2 - n1 <= EPSILON));
}