Return true if a given bit is set in a binary integer of arbitrary length.
bool isBitSet(int value, int bit) => (value & (1 << bit)) == 1 << bit;