(p, x, prec)
return r
exponentiation of a series modulo ``O(x**prec)``

    Examples
    ========

    >>> from sympy.polys.domains import QQ
    >>> from sympy.polys.rings import ring
    >>> from sympy.polys.ring_series import rs_exp
    >>> R, x = ring('x', QQ)
    >>> rs_exp(x**2, x, 7)
    1/6*x**6 + 1/2*x**4 + x**2 + 1
exponentiation of a series modulo ``O(x**prec)``
exponentiation of a series modulo O ( x ** prec )
def rs_exp(p, x, prec):
    """
    exponentiation of a series modulo ``O(x**prec)``

    Examples
    ========

    >>> from sympy.polys.domains import QQ
    >>> from sympy.polys.rings import ring
    >>> from sympy.polys.ring_series import rs_exp
    >>> R, x = ring('x', QQ)
    >>> rs_exp(x**2, x, 7)
    1/6*x**6 + 1/2*x**4 + x**2 + 1
    """
    ring = p.ring
    if _has_constant_term(p, x):
        raise NotImplementedError
    if len(p) > 20:
        return _exp1(p, x, prec)
    one = ring(1)
    n = 1
    k = 1
    c = []
    for k in range(prec):
        c.append(one/n)
        k += 1
        n *= k

    r = rs_series_from_list(p, c, x, prec)
    return r
def rs_exp ( p , x , prec ) : ring = p . ring if _has_constant_term ( p , x ) : raise NotImplementedError if len ( p ) > 20 : return _exp1 ( p , x , prec ) one = ring ( 1 ) n = 1 k = 1 c = [ ] for k in range ( prec ) : c . append ( one / n ) k += 1 n *= k r = rs_series_from_list ( p , c , x , prec ) return r