Skip to content

Instantly share code, notes, and snippets.

@raven38
Created October 6, 2014 14:26
Show Gist options
  • Save raven38/a390d0a4dee9e50c6a20 to your computer and use it in GitHub Desktop.
Save raven38/a390d0a4dee9e50c6a20 to your computer and use it in GitHub Desktop.
最下位ビットを見つけるだけ
// 1になってる最下位ビット以下を返す 10010なら10
// 10010 & 01111 から 00010
int lowbit(int x){
return x&-x;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment