def nextpowb(b, n):
    """Find :math:`p` that satisfies :math:`b^p \\ge |n|`.

    Parameters
    ----------
    b : int or float
        the base of the power :math:`p`. That is, the base :math:`b` in
        :math:`b^p`.
    n : int or float
        the value with absolute value that :math:`b^p` must be greater than
        or equal to.

    Returns
    -------
    p : int or float
        the power of :math:`b` satisfying :math:`b^p \\ge |n|`.

    """
    p = 0
    powb = b ** p
    while powb < abs(n):
        p = p + 1
        powb = b ** p
    return p
