FLINT3.7.0-dev

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)source
int fmpz_rsqrtmod_2exp(fmpz_t rop, const fmpz_t op, flint_bitcnt_t N)source

If 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).