code: function msb (x) {
    return (
      x & 0xF0
      ? x & 0xC0 ? x & 0x80 ? 8 : 7 : x & 0x20 ? 6 : 5
      : x & 0x0C ? x & 0x08 ? 4 : 3 : x & 0x02 ? 2 : x
    )
  }
docs: console.log(mod(13227, 28), 13227 % 28, ~~(13227 / 28)) find the most significant bit in a byte with a ternary based binary search...