~7 does not equal zero.
It gives a value for which all but the last 3 bits are ones.