I’ve been thinking about bits and two’s complement lately. Really fun stuff. When I was messing with alternating columns earlier today, I came upon this in the Immediate Window:
What the heck? Eventually, I looked up the Not Operator in help and read this
In addition, the Not operator inverts the bit values of any variable and sets the corresponding bit in result according to the following table:…
The table basically says if it’s a zero it goes to one and vice versa. Incidentally, it appears there’s a typo in the table. It looks like the letter ‘o’ instead of the number zero on the first line (Office 2000). All that means is that it’s changing the bits which results in a different number, binarily speaking. Such as ‘not 8’ equals -9. In binary:
not 8 = 1111 1111 1111 0111
-9 = 1111 1111 1111 0111
Some more examples:
Does Not convert everything to a Long before it calculates? Is that why this overflows? I’m sure this use of Not is useful somewhere, somehow.