News for hackers. Stuff that matters.
Re:Why 1 && 2 == 2 by unlimitedbacon on Friday July 19, 2013 @01:57AM (#6068552)
I am not a programmer, but it seems to me the logical thing to do would be to operate on the binary values of 1 and 2.

Since 1d = 01b and 2d = 10b...

1 AND 2 = 01 AND 10 = 00 = 0

1 OR 2 = 01 OR 10 = 11 = 3

Re:Why 1 && 2 == 2 by chewxy on Friday July 19, 2013 @02:41AM (#6068673)
That's kinda what binary logical operations are for. Typically AND is denoted by the symbol '&', and OR is denoted by the symbol '|'