fmpz_sqrtmod_2exp, fmpz_rsqrtmod_2exp
Synopsis
#include <flint/fmpz.h>int fmpz_sqrtmod_2exp(fmpz_t rop, const fmpz_t op, flint_bitcnt_t N)sourceint fmpz_rsqrtmod_2exp(fmpz_t rop, const fmpz_t op, flint_bitcnt_t N)sourceIf op is an odd square modulo 2^N (for N \ge 3: op \equiv 1 \pmod 8), set rop to a square root y, respectively an inverse square root (\mathit{op}\, y^2 \equiv 1), modulo 2^N, and return 1; otherwise return 0. The root returned is the one congruent to 1 modulo 4, reduced modulo 2^N. Even op is not supported (0 is returned).
Cite this page
The FLINT team, “fmpz_sqrtmod_2exp, fmpz_rsqrtmod_2exp (fmpz.h),” FLINT: Fast Library for Number Theory, documentation, version 3.7.0-dev, 2026. https://flintlib.org/doc/fmpz/fmpz_sqrtmod_2exp.html (generated 2026-10-20).
@misc{flint-doc-fmpz-fmpz-sqrtmod-2exp,
author = {{The FLINT team}},
title = {{fmpz\_sqrtmod\_2exp, fmpz\_rsqrtmod\_2exp (fmpz.h)}},
howpublished = {FLINT: Fast Library for Number Theory, documentation, version 3.7.0-dev},
year = {2026},
url = {https://flintlib.org/doc/fmpz/fmpz_sqrtmod_2exp.html},
note = {Generated 2026-10-20}
}