import math


def pack_size(value):
    """Returns the number of bytes required to represent a given value.

    Args:
      value (int): the natural number whose size to get

    Returns:
      The minimal number of bytes required to represent the given integer.

    Raises:
      ValueError: if ``value < 0``.
      TypeError: if ``value`` is not a number.
    """
    if value == 0:
        return 1
    elif value < 0:
        raise ValueError('Expected non-negative integer.')
    return int(math.log(value, 256)) + 1