'Raise ``f`` to a non-negative power ``n``.'

def pow(f, n):

    if isinstance(n, int):
        if (n < 0):
            (F, n) = (dup_invert(f.rep, f.mod, f.dom), (- n))
        else:
            F = f.rep
        return f.per(dup_rem(dup_pow(F, n, f.dom), f.mod, f.dom))
    else:
        raise TypeError(('``int``    expected,    got    %s' % type(n)))
