This would have worked if ieee hadn't severely messed up when (not) designing NaN semantics, but they did, so in rust, this can return false when comparing a NaN value to itself. (see the NaN section of https://doc.rust-lang.org/std/primitive.f32.html)
‘a.to_bits() == b.to_bits()’
Alternatively, use ‘partial_eq’ and fall back to bit equality if it returns None.