A sign bit is the additional bit in a C signed integer representation that indicates the sign: 0 represents a positive value, while 1 represents a negative value. Positive values retain the representation they have in the corresponding unsigned type; the sign bit affects how the upper part of the representation is interpreted. section 5.7.5
C permits three ways to use the sign bit:
- Sign and magnitude keeps the magnitude positive and uses the sign bit as a minus sign. section 5.7.5
- Ones’ complement complements every bit of the corresponding positive value. section 5.7.5
- Two’s complement, commonly used on modern platforms, interprets unsigned values whose high-order bit is 1 as negative. section 5.7.5
Negating an unsigned bit pattern
For a 16-bit value A = 240, the two’s-complement negative is formed as ~A + 1: complementing 0000000011110000 produces 1111111100001111, then adding one produces 1111111100010000, or 65296 as unsigned. section 5.7.5

