FLINT3.7.0-dev

acb_sqrt, acb_sqrt_analytic

Synopsis#include <flint/acb.h>
void acb_sqrt(acb_t y, const acb_t x, slong prec)source
void acb_sqrt_analytic(acb_t res, const acb_t z, int analytic, slong prec)source

Set the output to the principal square root, with the branch cut on (-\infty, 0) and \sqrt{-1} = i (continuous from above). If analytic is set, the result is indeterminate when the input touches the branch cut, including an exact negative real number.

If one part of z = a + bi is exactly zero, a single real square root suffices. In general \sqrt{a + bi} = u/2 + ib/u with u = \sqrt{2(|z| + a)}, which needs two real square roots; for a < 0 the roles of the parts are exchanged to avoid cancellation.

Guides#

Cite this page

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