Earlier quoted context omitted.
On a tangent — for a numeric library, would you rather NaN or throw? I find a fair amount of division over this question, but people lean towards throw over NaN.
If the operation can fail, that should really be represented in the type, right?
#[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 same