Ever heard of bit hacking?
Here's an extensive and free to use list of bit hacking methods, so that you can get the hell outta your program:
http://graphics.stanford.edu/~seander/bithacks.html#DetermineIfPowerOf2
Post #54
1.1K
TH The Art of Programming @theprogrammingart · 43.6K subscribers