有什么办法能最快的知道那些bit是1?# Programming - 葵花宝典
c*m
1 楼
I have some bit map string, I want to know which bit is 1.
For example
switch(bitvec)
{
case 0x0L:
return -1;
case 0x1L:
return 0;
case 0x2L:
return 1;
case 0x4L:
return 2;
case 0x8L:
r
For example
switch(bitvec)
{
case 0x0L:
return -1;
case 0x1L:
return 0;
case 0x2L:
return 1;
case 0x4L:
return 2;
case 0x8L:
r