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 pp (with e≥3e \ge 3 if p=2p = 2): if (x,xn)(x, \mathit{xn}) is a unit and a square modulo pp (modulo 8 if p=2p = 2), set (res,n)(\mathit{res}, n) to a square root of xx modulo BnB^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 pp 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-11-02).