FLINT3.7.0-dev

arf_sqrt, arf_sqrt_ui, arf_sqrt_fmpz

Synopsis#include <flint/arf.h>
int arf_sqrt(arf_ptr z, arf_srcptr x, slong prec, arf_rnd_t rnd)source
int arf_sqrt_ui(arf_t z, ulong x, slong prec, arf_rnd_t rnd)source
int arf_sqrt_fmpz(arf_t z, const fmpz_t x, slong prec, arf_rnd_t rnd)source

Set z to x\sqrt{x}, correctly rounded for the strict modes. A negative x gives NaN. The relaxed modes are accepted.

As arf_div, with _arf_mpn_sqrt: the exact truncated root of the mantissa padded to 2 rn2 \, \mathit{rn} limbs (flint_mpn_sqrthigh_exact, with the half bit for rounding to nearest at a limb boundary) up to the Newton range, which is cheaper than the guard limb; the one-limb root in registers (_flint_mpn_isqrt_2_rem), here inlined for one-limb operands at up to one limb of precision. A power of two with an odd exponent is exact.

Cite this page

The FLINT team, “arf_sqrt, arf_sqrt_ui, arf_sqrt_fmpz (arf.h),” FLINT: Fast Library for Number Theory, documentation, version 3.7.0-dev, 2026. https://flintlib.org/doc/arf/arf_sqrt.html (generated 2026-11-20).