位运算技巧 lowbit 1 inline int lowbit ( int x) 2 { 3 return x & - x; 4 } lowbit 返回最右侧的1例如: lowbit(0b0011) == 0b1 lowbit(0b001100) == 0b100 lowbit(0b10101010) == 0b10 lowbit(0b100) == 0b100 gcc内置位运算函数 •int …
位运算技巧 lowbit 1 inline int lowbit ( int x) 2 { 3 return x & - x; 4 } lowbit 返回最右侧的1例如: lowbit(0b0011) == 0b1 lowbit(0b001100) == 0b100 lowbit(0b10101010) == 0b10 lowbit(0b100) == 0b100 gcc内置位运算函数 •int …
讨论
登录后参与讨论
还没有评论,来说第一句吧。