FLINT3.7.0-dev

ca_get_fexpr

Synopsis#include <flint/ca.h>
void ca_get_fexpr(fexpr_t res, const ca_t x, ulong flags, ca_ctx_t ctx)source

Sets res to a symbolic expression for x. Rational numbers and special values give simple expressions. Other numbers give an expression Where(f(a_1, ..., a_n), Def(a_1, e_1), ..., Def(a_n, e_n)) that defines symbols a_1, a_2, ... for the extension numbers involved (recursively) and expresses x as a rational function of them.

With flags = 0, algebraic extension numbers are written as Sqrt(n)-type formulas when they are Gaussian rationals or quadratic, and otherwise as PolynomialRootNearest(coeffs, approx) with a decimal approximation; this is readable but cannot always be parsed back unambiguously. With flags = CA_FEXPR_SERIALIZATION, algebraic numbers are written exactly with AlgebraicNumberSerialized (see qqbar_get_fexpr_repr), so that ca_set_fexpr recovers the same number.

Guides#

Cite this page

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