5
25 == 32 < 49 < 26 == 64
So, starting with 25:
Power of 2 | Include? | Subtraction | Binary so Far |
---|---|---|---|
25 == 32 | 32 is less than 49 | 49 - 32 == 17 | 1 _ _ _ _ _ |
24 == 16 | 16 is less than 17 | 17 - 16 == 1 | 1 1 _ _ _ _ |
at this point you can jump to the end: | |||
20 == 1 | 1 equals 1 | 1 - 1 == 0 | 1 1 0 0 0 1 |
So 49 represented in binary is 110001.
What is the largest power of two less than or equal to 119 ?