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 (−∞,0)(-\infty, 0) and −1=i\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+biz = a + bi is exactly zero, a single real square root suffices. In general a+bi=u/2+ib/u\sqrt{a + bi} = u/2 + ib/u with u=2(∣z∣+a)u = \sqrt{2(|z| + a)}, which needs two real square roots; for a<0a < 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-11-02).