isPowerOfTwo static method

bool isPowerOfTwo(
  1. int value
)

Implementation

static bool isPowerOfTwo(int value) {
  return (value & (value - 1)) == 0 && value != 0;
}