n_sqrtmod_2pow, n_sqrtmod_primepow, n_sqrtmodn
Synopsis
#include <flint/ulong_extras.h>slong n_sqrtmodn(ulong ** sqrt, ulong a, n_factor_t * fac)sourceCompute all square roots of a modulo 2^{\mathit{exp}}, modulo p^{\mathit{exp}}, or modulo an integer m given by its factorisation, and return their number. The roots are written to a newly allocated array stored in *sqrt, which the caller frees with flint_free. If a is not a square, 0 is returned and *sqrt is set to NULL.
Cite this page
The FLINT team, “n_sqrtmod_2pow, n_sqrtmod_primepow, n_sqrtmodn (ulong_extras.h),” FLINT: Fast Library for Number Theory, documentation, version 3.7.0-dev, 2026. https://flintlib.org/doc/ulong_extras/n_sqrtmod_2pow.html (generated 2026-10-20).
@misc{flint-doc-ulong-extras-n-sqrtmod-2pow,
author = {{The FLINT team}},
title = {{n\_sqrtmod\_2pow, n\_sqrtmod\_primepow, n\_sqrtmodn (ulong\_extras.h)}},
howpublished = {FLINT: Fast Library for Number Theory, documentation, version 3.7.0-dev},
year = {2026},
url = {https://flintlib.org/doc/ulong_extras/n_sqrtmod_2pow.html},
note = {Generated 2026-10-20}
}