import math


def next_pow2(i):
    """
    Find the next power of two

    >>> int(next_pow2(5))
    8
    >>> int(next_pow2(250))
    256
    """
    # do not use NumPy here, math is much faster for single values
    exponent = math.ceil(math.log(i) / math.log(2))
    # the value: int(math.pow(2, exponent))
    return exponent