isPowerOf2 static method

bool isPowerOf2(
  1. int x
)

Implementation

static bool isPowerOf2(int x) => (x & (x - 1)) == 0;