Hacker News new | ask | show | jobs
by unlimitedbacon 4717 days ago
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

1 comments

That's kinda what binary logical operations are for. Typically AND is denoted by the symbol '&', and OR is denoted by the symbol '|'