radix_sqrtrem
Synopsis
#include <flint/radix.h>Sets (s, \lceil \mathit{an}/2 \rceil) to \lfloor \sqrt a \rfloor and, if r is not NULL, (r, \lceil \mathit{an}/2 \rceil + 1) to the remainder a - s^2 \le 2s. Requires \mathit{an} \ge 1 and a_{an-1} \ne 0. Inputs shorter than a cutoff depending on the size of B (43 limbs for B = 10^{19}) are converted to binary and use flint_mpn_sqrtrem; longer ones use the Newton square root.
Cite this page
The FLINT team, “radix_sqrtrem (radix.h),” FLINT: Fast Library for Number Theory, documentation, version 3.7.0-dev, 2026. https://flintlib.org/doc/radix/radix_sqrtrem.html (generated 2026-10-20).
@misc{flint-doc-radix-radix-sqrtrem,
author = {{The FLINT team}},
title = {{radix\_sqrtrem (radix.h)}},
howpublished = {FLINT: Fast Library for Number Theory, documentation, version 3.7.0-dev},
year = {2026},
url = {https://flintlib.org/doc/radix/radix_sqrtrem.html},
note = {Generated 2026-10-20}
}