Why compiler does 2's complement in the bitwise NOT operation?
example :
~5 = -6
~5 = 1010
which is actually 10 in decimal
but compiler takes 2's complement of 1010 which will be -6.
Why compiler does 2's complement in the bitwise NOT operation?
example :
~5 = -6
~5 = 1010
which is actually 10 in decimal
but compiler takes 2's complement of 1010 which will be -6.