|
|
|
|
|
by MaxBarraclough
759 days ago
|
|
I think strictly speaking signedness does affect things, assuming we're talking C/C++. If x has type int and were to take the value of INT_MIN, then evaluating -x would result in a signed arithmetic overflow, which is undefined behaviour. (Related: the C standard now insists on use of 2's complement, where it used to permit other schemes.) If x had type unsigned int, this wouldn't introduce undefined behaviour. |
|