def is_power_of_2(num):
    """
    Returns whether num is a power of two or not
    :param num: an integer positive number
    :return: True if num is a power of 2, False otherwise
    """
    return num != 0 and num & num - 1 == 0
