I have these possible bit flags.
1, 2, 4, 8, 16, 64, 128, 256, 512, 2048, 4096, 16384, 32768, 65536
So each number is like a true/false sta
One way would be to loop through your number, left-shifting it (ie divide by 2) and compare the first bit with 1 using the & operand.