FLINT3.7.0-dev

padic_radix_sqrt, padic_radix_rsqrt

Synopsis#include <flint/padic_radix.h>
int padic_radix_sqrt(padic_radix_t res, const padic_radix_t x, gr_ctx_t ctx)source
int padic_radix_rsqrt(padic_radix_t res, const padic_radix_t x, gr_ctx_t ctx)source

Set res to a square root \sqrt x, respectively 1/\sqrt x, with relative precision equal to that of x (one digit less for p = 2), capped by the context. The root is a fixed canonical branch, so that a result at lower precision is the truncation of the result at higher precision, and rsqrt gives the reciprocal of sqrt. An exact perfect square gives its exact root. Return GR_DOMAIN if x has odd valuation or its unit is not a square (and for rsqrt if x is an exact zero), and GR_UNABLE if x is not known to be nonzero, if p = 2 and the unit is known to fewer than 3 digits, or if the context is exact and the root is irrational. sqrt of an exact zero is zero.

Guides#

Cite this page

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