I read that floats/doubles equality should be implemented using an interval (given by some epsilon):
bool aresame(double a, double b)
{
return (fabs(a-b) < EPSILON);
}
Is their any predefined value of EPSILON that I can use or do I have to define it myself, something like, 0.0000000001
?
No comments:
Post a Comment