def is_pow2(n):
    """
    Check whether a number is power of 2

    Parameters
    ----------
    n: int
        A positive integer number

    Returns
    -------
    bool

    """
    return n > 0 and ((n & (n - 1)) == 0)
    # Solution 2
    # return math.log2(n) % 1 == 0