_nmod_poly_sqrt, nmod_poly_sqrt
Synopsis
#include <flint/nmod_poly.h>int nmod_poly_sqrt(nmod_poly_t b, const nmod_poly_t a)sourceIf is the square of a polynomial, set to a square root and return 1; otherwise return 0 (and set ). Requires a prime modulus. The underscore version requires , writes coefficients and does not allow aliasing.
For , is a square exactly when its odd coefficients vanish. Otherwise the low coefficients of a candidate root are computed with _nmod_poly_sqrt_series after removing an even power of and scaling the constant term to 1, and the candidate is accepted if its square agrees with in the remaining coefficients.
Cite this page
The FLINT team, “_nmod_poly_sqrt, nmod_poly_sqrt (nmod_poly.h),” FLINT: Fast Library for Number Theory, documentation, version 3.7.0-dev, 2026. https://flintlib.org/doc/nmod_poly/_nmod_poly_sqrt.html (generated 2026-11-02).
@misc{flint-doc-nmod-poly-nmod-poly-sqrt,
author = {{The FLINT team}},
title = {{\_nmod\_poly\_sqrt, nmod\_poly\_sqrt (nmod\_poly.h)}},
howpublished = {FLINT: Fast Library for Number Theory, documentation, version 3.7.0-dev},
year = {2026},
url = {https://flintlib.org/doc/nmod_poly/_nmod_poly_sqrt.html},
note = {Generated 2026-11-02}
}