Advertisement
Guest User

Untitled

a guest
Nov 18th, 2018
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.18 KB | None | 0 0
  1. int trailing_zeroes(uint n) {
  2. uint count = 0;
  3. uint mask = 0x00000001;
  4.  
  5. while (n) {
  6. if ((n & 1) == 1)
  7. break;
  8. else {
  9. count++;
  10. n >>= mask;
  11. }
  12. }
  13. return count;
  14. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement