0

I have a set of binary numbers (originally was hex's) that I want to find the index of 1 in it. These sets are :

1000, index = 3
0100, index = 2
0010, index = 1
0001, index = 0

I can't wrap my head around it, I tried getting the decimal representation and do some math magic with it to turn it into 0, 1, 2, 3 but no clue.

Sergey Kalinichenko
  • 697,062
  • 78
  • 1,055
  • 1,465
Rafael Adel
  • 7,431
  • 23
  • 74
  • 115

0 Answers0