Bitwise NOT operation on integers

100 views Asked by At

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.

0

There are 0 answers