Hacker News new | ask | show | jobs
by Snarwin 1564 days ago
Given two binary numbers a and b, the set of bits set to 1 in a|b is the union of the set of bits set to 1 in a and the set of bits set to 1 in b. Likewise for & (bitwise and) and intersection. So using bitwise operators to represent set operations like this is not too big of a stretch.