I\'m looking for the fastest way of counting the number of bit transitions in an unsigned int.
unsigned int
If the int contains: 0b0000000000000000000000000000101
0b0000000000000000000000000000101
What language?
I would loop 64 times and then bit shift your number to inspect of the bits, then store the previous bit and compare it to the current one. If it's different, incremember your count.