ca_sqrt_inert, ca_sqrt_nofactor, ca_sqrt_factor, ca_sqrt
#include <flint/ca.h>Sets res to the principal square root of x, with \operatorname{Re}(\sqrt{x}) \ge 0 and \sqrt{x} = i \sqrt{|x|} for negative real x.
The inert version returns the generator of the field \mathbb{Q}(\sqrt{x}) without trying to simplify. The nofactor version tries cheap simplifications, in particular an exact evaluation of \sqrt{x} as an algebraic number of moderate degree. The factor version also writes x = A^2 B by factoring the representation of x (with the factorisation options flags, see ca_factor) and returns \pm A \sqrt{B} with the sign chosen to give the principal root; the factorisation is a heuristic and B need not be minimal. ca_sqrt currently calls ca_sqrt_factor with CA_FACTOR_POLY_SQF | CA_FACTOR_ZZ_SMOOTH, so that for example \sqrt{12 \pi} becomes 2 \sqrt{3 \pi}.
For special values: \sqrt{c \infty} = \sqrt{c} \, \infty, \sqrt{\tilde \infty} = \tilde \infty, and Undefined and Unknown map to themselves.
Guides#
The FLINT team, “ca_sqrt_inert, ca_sqrt_nofactor, ca_sqrt_factor, ca_sqrt (ca.h),” FLINT: Fast Library for Number Theory, documentation, version 3.7.0-dev, 2026. https://flintlib.org/doc/ca/ca_sqrt_inert.html (generated 2026-10-20).
@misc{flint-doc-ca-ca-sqrt-inert,
author = {{The FLINT team}},
title = {{ca\_sqrt\_inert, ca\_sqrt\_nofactor, ca\_sqrt\_factor, ca\_sqrt (ca.h)}},
howpublished = {FLINT: Fast Library for Number Theory, documentation, version 3.7.0-dev},
year = {2026},
url = {https://flintlib.org/doc/ca/ca_sqrt_inert.html},
note = {Generated 2026-10-20}
}