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 \mathit{poly}^e by binary exponentiation; the two pairs of functions are the same. The underscore versions require \mathit{len} \ge 1 and e \ge 1, write (\mathit{len} - 1) e + 1 coefficients and do not allow aliasing. nmod_poly_pow returns 1 for 0^0, but nmod_poly_pow_binexp returns 0.

A factor x^k of poly is removed first and contributes x^{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((\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-10-20).