FLINT3.7.0-dev

gr_ctx_init_gr_complex

Synopsis#include <flint/gr.h>
void gr_ctx_init_gr_complex(gr_ctx_t ctx, gr_ctx_t real_ctx)source

Initialises ctx to the algebra R[i] with i^2 = -1 over the ring R given by real_ctx. An element a + bi is stored as the pair (a, b) of elements of R, contiguously.

Typically R is an implementation of the real numbers or of a subring of them (for example nfloat), and the result is the complex numbers or a subring. The construction also makes sense over real vector spaces and over general rings, in which i is a formal element with i^2 = -1, but then operations beyond basic arithmetic (absolute value, argument) may not make sense.

Cite this page

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