def integer_bit_length_shift_counting(num):
    """
  Number of bits needed to represent a integer excluding any prefix
  0 bits.

  :param num:
      Integer value. If num is 0, returns 0. Only the absolute value of the
      number is considered. Therefore, signed integers will be abs(num)
      before the number's bit length is determined.
  :returns:
      Returns the number of bits in the integer.
  """
    bits = 0
    if num < 0:
        num = -num
    if num == 0:
        return 0
    while num >> bits:
        bits += 1
    return bits
