Signedness determines whether an integer type can represent negative values. In C, mixing signed and unsigned operands triggers implicit conversions, and the result can differ from what the source code appears to say. A negative signed value may become a large unsigned value, changing comparisons and arithmetic. section 5.4
A comparison that changes meaning
The comparison -1 < 0 is true, while -1 < 0U is false: the signed -1 is converted to unsigned int before comparison. Comparisons involving wider signed and unsigned types can also depend on platform widths. TAKEAWAY: avoid operations with operands of different signedness, and choose arithmetic types that avoid problematic implicit conversions. section 5.4
double a = 1; // Harmless; value fits type signed short b = -1; // Harmless; value fits type signed int c = 0x8000'0000; // Dangerous; value too big for type signed int d = -0x8000'0000; // Dangerous; value too big for type signed int e = -2'147'483'648; // Harmless; value fits type unsigned short g = 0x8000'0000; // Loses information; has value 0
Use the assignments to compare values that fit their destination types with values that overflow or lose information, including signed and unsigned integer cases. section 5.4

