Bitwise operator performance test We can test if a number is a power of 2 in 2 ways: mod(log2(n),1)==0 AND(n,n-1)==0 This project compares the performance of log2 vs bitwise operators. On a real CPU AND register the bitwise operator would be much faster.