FLINT3.7.0-dev

_nmod_poly_pow, nmod_poly_pow, _nmod_poly_pow_binexp, nmod_poly_pow_binexp

Synopsis#include <flint/nmod_poly.h>
void _nmod_poly_pow(nn_ptr res, nn_srcptr poly, slong len, ulong e, nmod_t mod)source
void nmod_poly_pow(nmod_poly_t res, const nmod_poly_t poly, ulong e)source
void _nmod_poly_pow_binexp(nn_ptr res, nn_srcptr poly, slong len, ulong e, nmod_t mod)source
void nmod_poly_pow_binexp(nmod_poly_t res, const nmod_poly_t poly, ulong e)source

Set res to polye\mathit{poly}^e by binary exponentiation; the two pairs of functions are the same. The underscore versions require len≥1\mathit{len} \ge 1 and e≥1e \ge 1, write (len−1)e+1(\mathit{len} - 1) e + 1 coefficients and do not allow aliasing. nmod_poly_pow returns 1 for 000^0, but nmod_poly_pow_binexp returns 0.

A factor xkx^k of poly is removed first and contributes xkex^{ke}. The squarings and multiplications by poly are products truncated to the length of the result, so the cost is dominated by the last squaring, about M((len−1)e)M((\mathit{len} - 1) e).

Cite this page

The FLINT team, “_nmod_poly_pow, nmod_poly_pow, _nmod_poly_pow_binexp, nmod_poly_pow_binexp (nmod_poly.h),” FLINT: Fast Library for Number Theory, documentation, version 3.7.0-dev, 2026. https://flintlib.org/doc/nmod_poly/_nmod_poly_pow.html (generated 2026-11-02).