import math


def power2(x):
    """power2(x) -> nearest power of two
    
    Calculate the nearest power of two that is equal
    or greater than x
    """
    p = math.log(x) / math.log(2)
    return 2**int(math.ceil(p))