F
fungus
I reported this bug years ago but it's still not fixed.
On this page: http://c-faq.com/fp/fpequal.html
it says to use the following code:
if (fabs(a - b) <= epsilon * fabs(a))
What happens when a is zero and b is (eg.) epsilon/2?
In this case a and b should compare as equal, but they don't...
On this page: http://c-faq.com/fp/fpequal.html
it says to use the following code:
if (fabs(a - b) <= epsilon * fabs(a))
What happens when a is zero and b is (eg.) epsilon/2?
In this case a and b should compare as equal, but they don't...