3 ms·
It's a little bit more complicated than that. If only the most significant bit represented the sign then you'd have both positive and negative zero (which is po
by craftkiller 1y ago
It's a little bit more complicated than that. If only the most significant bit represented the sign then you'd have both positive and negative zero (which is possible with floats), and you'd only be able to go from [-127 to 127]. Instead, it's some incantation where the MSB is the sign but then you flip all the bits and add 1. It is only relevant for signed integers, not unsigned integers.
- pests 1y agoBen Eater has a really good YT video on this.