Loading page…
A number is a row of switches, and signed numbers use two's complement. AND, OR and exclusive or work one column at a time, and x AND x minus one clears the lowest one bit, which counts bits and tests for a power of two. Exclusive or finds the one value without a pair, and a bitmask holds a small set in one number. Overflow, shifts and negative remainders differ between Python, Java, C plus plus and JavaScript. Modular arithmetic, Euclid's gcd, the sieve and fast power finish the picture.
You work on a chat app.