Reset a given bit in a binary integer of arbitrary length.
int resetBit(int value, int bit) => value & ~(1 << bit);