#define QUESTION (BB | !BB)
by davy hollevoet
back to homepage


Discussion
Everything was cool in to be or not to be land, until I received a mail from Bart Coppens. He said there was an error on my QUESTION page. He even wrote an entire page about it. In short, the error lies in the NOT-operation. Bart is right, but not completely, because I didn't define QUESTION, I merely found it somewhere. My page about QUESTION is only one interpretation: I know it was defined with '!' instead of '~', but I think our programming Shakespeare ment '~' instead of '!'. So I made no mistakes, I just didn't tell everything :).


QUESTION=??

QUESTION is defined as (BB | !BB)

If we assume that BB is hexadecimal notation of 187,
BB (0xBB) equals 10111011 in binary.

On the other side of "|" it says "!BB".
The "!" in C(++) is a NOT operator. Now we perform a bitwise NOT operation on 0xBB.

  10111011
NOT

  01000100

So !BB equals 01000100 (=68)

The operator between "BB" and "!BB" is "|", which is the bitwise OR operator in C(++).

  10111011 187
  01000100 68
OR

 
  11111111 255


The result is 11111111 (=255) and the hexadecimal notation is 0xFF.

So I conclude that QUESTION equals 0xFF and that
Shakespeare knew C++;

information by davy hollevoet