FLINT3.7.0-dev

_nmod_poly_pow_trunc, nmod_poly_pow_trunc, _nmod_poly_pow_trunc_binexp, nmod_poly_pow_trunc_binexp

Synopsis#include <flint/nmod_poly.h>
void _nmod_poly_pow_trunc(nn_ptr res, nn_srcptr poly, ulong e, slong trunc, nmod_t mod)source
void nmod_poly_pow_trunc(nmod_poly_t res, const nmod_poly_t poly, ulong e, slong trunc)source
void _nmod_poly_pow_trunc_binexp(nn_ptr res, nn_srcptr poly, ulong e, slong trunc, nmod_t mod)source
void nmod_poly_pow_trunc_binexp(nmod_poly_t res, const nmod_poly_t poly, ulong e, slong trunc)source

Set res to \mathit{poly}^e \bmod x^{\mathit{trunc}} by binary exponentiation with truncated products; the two pairs of functions are the same. The underscore versions read exactly trunc coefficients of poly (zero-pad shorter inputs), require \mathit{trunc} \ge 1 and e \ge 1, write trunc coefficients and do not allow aliasing.

For a power series with constant term 1 and e much larger than trunc, \exp(e \log(\mathit{poly})) with nmod_poly_log_series and nmod_poly_exp_series can be faster, provided the modulus is a prime larger than trunc.

Cite this page

The FLINT team, “_nmod_poly_pow_trunc, nmod_poly_pow_trunc, _nmod_poly_pow_trunc_binexp, nmod_poly_pow_trunc_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_trunc.html (generated 2026-10-20).