bool is_multiple_of_3(unsigned x) { unsigned y; do { y = 0; while (x) { y += x & 3; x >>= 2; } x = y; } while (y > 5); return y == 3; }
-
-
@tehjh Simplified for tweet, trivial to fix if needed. My is_multiple_of_9() will happen to handle 0 right with no tweet space wasted. -
- 6 more replies
New conversation -
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.