It's OK to compare floating-points for equality | Hacker News
TL;DR AI
2 min readKey summary
Hacker News commenters argued that using `f64::EPSILON` as a universal float-equality threshold is usually wrong.
They noted that epsilon describes spacing near 1.0, so it does not scale well across large or small magnitudes.
The discussion recommended exact equality for exact checks, and separate APIs for absolute, relative, or distance-based tolerances.
This matters in assertions and computational geometry, where scale-aware error handling is essential.



