I see a menacing dark cloud looming on the horizon and I wonder why other beginners aren't as concerned as I am.
Have they ever had to deal with floating point comparisons?
Does it not bother them that some mathematical inequalities, completely reasonable for real numbers, seem to unexplicably fail?
Maybe real-world problems are simple enough that "abs(a-b) < epsilon" suffice?
I recently read this [1] article and fell into despair about how difficult it is to compare floating point numbers. I took a shot at reading one of the white papers alluded to in the article, [2], on "Fortune-van-Wyk bound", and found it really dense (I haven't finished reading).
The problem surely can't be trivial (if someone went through the trouble of writing 59 pages about it) but where rubber meets the road, *someone* had to use some non-trivial version of these algorithms to deal with floating-point applications. I can't imagine that we always work in integer-land, especially if the application is naturally graphical (e.g., google sketchup).
So I ask: where is the happy medium between "abs(a-b) < epsilon" and [2]?
[1] double - and how to use it
https://cplusplus.com/forum/articles/3827/
[2] Adaptive Precision Floating-Point Arithmetic and Fast Robust Geometric Predicates
https://people.eecs.berkeley.edu/~jrs/papers/robustr.pdf