lowbit()的原理及证明


lowbit()代码:

#define lowbit(x) (x&-x) //method 1

int lowbit(int x){
	return x&(-x);
} //method 2

int lowbit(int x){
	return x&(~x+1);
}  //method 3