2 ms·
One of my random thoughts is that floats could be represented as enums in type system, e.g. in rust-like syntax: #[repr(f32)] enum Float32 { Po
by zokier 3y ago
One of my random thoughts is that floats could be represented as enums in type system, e.g. in rust-like syntax:
#[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
- truculent 3y agoYeah, I think something like this would make sense. I get why people might not like it, but this is what we’re dealing with whether we like it or not.