yphastos
8/1/2017 - 9:48 PM

different Rightmost Bit

different Rightmost Bit

function differentRightmostBit(n, m) {
  return (n^m) & -(n^m);
}

function differentRightmostBit(n, m) {
  return (n ^= m) & -n;
}

function differentRightmostBit(n, m) {
  return (n ^ m) & (~(n ^ m) + 1);
}