It basically goes through every 2^x where X is less than the # and if it can subtract the X, do so, then proceed - if it is < 0 then skip that subtraction and return false
So say for that function oddeven thing:
if the number is 20 (x = 20)
20 - 16 ( >= 0) x & 16 = true
4 - 8 ( < 0) x & 8 = false
4 - 4 ( >= 0) x & 4 = true
0 - 2 ( < 0) x & 2 = false
0 - 1 ( < 0) x & 1 = false
|