function getSizeInBytes(x) {
  // n bits are required for numbers up to 2^n - 1.
  // So for a number x, we need ceil(log2(1 + x)) bits.
  return Math.ceil(Math.ceil(Math.log2(1 + x)) / 8);
}
Get the number of bytes to use to represent the given positive integer.
If n is zero, the function returns 0 which means that we don't need to waste
a byte to represent it.
@param {number} x - a positive integer.
@returns {number}