function updateBit(n, i, b) {
  return (b > 0) ? setBit(n, i) : clearBit(n, i);
}
Set/clear bit at a given index
@param n number
@param i index
@param b bit
@returns {number} new number with a given bit set/cleared