3 ms·
That's not true – you could easily pick one of the 255 representations here as the representation and make sure that all operations always produce that one. The
by StefanKarpinski 13y ago
That's not true – you could easily pick one of the 255 representations here as the representation and make sure that all operations always produce that one. Then you're still wasting a whole byte of your representation – and one in 255 bit patterns are invalid – but at least you can check for equality using bitwise comparison, and operations don't have to worry about all the possible representation of each value.
- StefanKarpinski 13y agoCorrection: as was pointed out above, there isn't actually a whole byte of waste in this representation. It varies from 255 representations of zero, 17 of 10^-127, to only one representation of numbers that can't be shifted left or right without overflowing or losing bits.