3 ms·
> If we have some positive 32-bit integers A and B then if A < B, f32::from_bits(A) < f32::from_bits(B) That is, if both are valid floats that represent a fini
by xigoi 2y ago
> If we have some positive 32-bit integers A and B then if A < B, f32::from_bits(A) < f32::from_bits(B)
That is, if both are valid floats that represent a finite non-zero number.
- deleted 2y ago[deleted]
- pauli5 2y agoCorrect. Floats support both -0 and 0 they compare equal but their bit representations don't. Zero can be tricky. Not a numbers (NaNs) always compare as false. Their bit representations won't.