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