FLINT3.7.0-dev

ca_set_qqbar

Synopsis#include <flint/ca.h>
void ca_set_qqbar(ca_t res, const qqbar_t x, ca_ctx_t ctx)source

Sets res to the algebraic number x.

A rational x gives an element of Q\mathbb{Q}, and an irrational x an element of a field Q(a)\mathbb{Q}(a) with one algebraic generator (never of a field with several generators: 2+3\sqrt{2} + \sqrt{3} is not recognised as an element of Q(2,3)\mathbb{Q}(\sqrt{2}, \sqrt{3})). A quadratic x is written as an element of Q(N)\mathbb{Q}(\sqrt{N}), where NN is the discriminant of its minimal polynomial with small square factors removed by smooth factorisation, so that for example 12\sqrt{12} and 1+31 + \sqrt{3} share the field Q(3)\mathbb{Q}(\sqrt{3}). Higher-degree numbers are made generators of their own field Q(x)\mathbb{Q}(x).

Guides#

Cite this page

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