Ad
  • Default User Avatar

    It runs the same as n%2 because compilers turn it into a bit test, it only runs faster with optimizer turned off. I used it because once you're familiar with bit ops, it becomes a self-explanatory idiom.