I do a number sign replacement according to the rule: invert bit by bit, and add 1, but I work with an integer data type not sbyte. How does the compiler understand that I am changing the sign,
and not returning the value 255?
int operand1 = 0, operand2 = 0;
int result;
operand1 = 0x01; // [0000 0001]
result = ~operand1; // [1111 1110]
result++; // [1111 1111]
Console.WriteLine(" ~ {0} + 1 = {1} ", operand1, result);
output: " ~ 1 + 1 = -1 "