&, |, ^, and ~ are all bitwise operators in python. &, ^, and | are all working fine for me - when i take, say, 1|0, I get 1. But ~ is giving me strange results. ~1 gives me -2, and ~0 gives me -1. Is this because I'm using integers or something? I'm running python 3.
I'm hoping to get 1 from ~0, and 0 from ~1 (the integers). Is this possible?