isSet static method

bool isSet(
  1. int n,
  2. int bitPosition
)

Returns true if bit is set in n at bitPosition.

Implementation

static bool isSet(int n, int bitPosition) => (n >> bitPosition) & 1 == 1;