A sign bit is the additional bit in a signed integer representation that distinguishes nonnegative from negative values. A value with sign bit 0 is positive; with sign bit 1, it is negative. C23 permits only two’s-complement sign representation, where the upper half of the corresponding unsigned range is interpreted as negative. section 5.7.5
Negating a 16-bit pattern
For unsigned value 240, bitwise complement followed by one produces 65,296: ~240 + 1. In two’s complement, the resulting pattern has its high-order bit set and represents the corresponding negative value when interpreted as signed. section 5.7.5
bool is_negative(unsigned a) {
constexpr unsigned int_max = UINT_MAX/2;
return a > int_max;
}
bool is_signed_less(unsigned a, unsigned b) {
if (is_negative(a) != is_negative(b)) return a > b;
else return a < b;
}
Use the sign bit to classify an unsigned value: values above UINT_MAX/2 have a set high-order bit and compare as negative when interpreted as signed. section 5.7.5

