So as I was reading about ~,
Performs the NOT operator on each bit.
So I tried:
0 = 00000000000000000000000000000000
so ~0 should be
~0 = 11111111111111111111111111111111
But when I tried, it returns -1. Isn’t 11111111111111111111111111111111 is 4294967295 in decimal?
It’s interpreted as a signed integer, and in two’s complement, an integer with all bits 1 is
-1.