FLINT3.7.0-dev

radix_sqrtmod_bn, radix_rsqrtmod_bn

Synopsis#include <flint/radix.h>
int radix_sqrtmod_bn(nn_ptr res, nn_srcptr x, slong xn, slong n, const radix_t radix)source
int radix_rsqrtmod_bn(nn_ptr res, nn_srcptr x, slong xn, slong n, const radix_t radix)source

For a prime digit radix p (with e \ge 3 if p = 2): if (x, \mathit{xn}) is a unit and a square modulo p (modulo 8 if p = 2), set (\mathit{res}, n) to a square root of x modulo B^n, respectively to the inverse of that square root, and return 1; otherwise return 0. The square root returned is the one whose residue modulo p is the smallest nonnegative one.

Cite this page

The FLINT team, “radix_sqrtmod_bn, radix_rsqrtmod_bn (radix.h),” FLINT: Fast Library for Number Theory, documentation, version 3.7.0-dev, 2026. https://flintlib.org/doc/radix/radix_sqrtmod_bn.html (generated 2026-10-20).