trying to negate a boolean mask I've come across this behavior:
~1
gives -2
, ~0
gives -1
.
I somewhat remember this pattern from my System Programming class. Has it something to do with the two's or one's complement?
Thanks, I was able to negate it, I'm just curious about what this does.