Hot Take: Rust Panic's are about as bad as Sig11s from the C world. I don't get good debug information in the typical case - and library authors get to decide when my program crashes (which I disagree with).
#[repr(f32)]
enum Float32 {
PositiveInfinity,
NegativeInfinity,
Nan(NanPayload32),
Finite(FiniteFloat32),
}
You could also then define NonNanFloat32 etc which could be used for certain operations. Of course on machine level its all the sameLike, if I'm doing x + y, and y just accidentally happens to contain the wrong data because of a mistake in the code, a NaN means the code will proceed as normal, and nobody will notice anything is wrong. If it's not a noticeable bug, it might be a long time until it's spotted by someone. And when they do, who knows how much damage it will have caused.
As a program author, I'd expect that it's my choice how to handle this situation. I don't want libraries making arbitrary decisions about how my code should work.