Working With Binary
I have a decimal number that I need to convert to binary, then retrieve the value of the nth digit as boolean...
For example:
5 decimal
equals 101 binary
what is second bit?
I can do it by converting to string, but I was hoping for a way using pure math
-------------------------
Beware of programmers with screwdrivers...
__________________
-------------------------
Beware of programmers with screwdrivers...
|