▲ | craftkiller 3 days 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 3 days ago | parent [-] | |
Ben Eater has a really good YT video on this. |