I believe $not is acting as a bitwise NOT, rather than a boolean NOT. If this is the case, then it is behaving correctly - ~0x00000000 == 0xFFFFFFFF, or 4294967295.