I understand why Rust doesn't let you use ==
with floating point numbers. Comparing the results of two floating point computations for equality is foolish.
BUT!
I've got some code that's working with data coming in over a network channel, and I want to know whether the f64 I got this time is the same or different than the f64 I got last time. Did I get the same bit pattern, or not? But by the time I get it, it's already been presented to me as an f64.
I'm current checking (val1 - val2).abs() < f64::EPSILON
, which really puts it on entirely the wrong footing.
How do I easily check whether the bits are the same?