isPowerOf2 function

bool isPowerOf2(
  1. int n
)

Implementation

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