FLINT3.7.0-dev

gr_ctx_init_gr_fraction

Synopsis#include <flint/gr.h>
void gr_ctx_init_gr_fraction(gr_ctx_t ctx, gr_ctx_t domain, int flags)source

Initialises ctx to the fraction field of the integral domain domain. A fraction is stored as two consecutive elements of the domain (numerator, denominator). By default fractions are reduced by removing the common content with gr_gcd and the denominator is normalised by gr_canonical_associate. flags is a combination of GR_FRACTION_NO_REDUCTION and GR_FRACTION_STRONGLY_CANONICAL, or 0.

The constructor does not verify that domain is an integral domain. Over a ring with zero divisors the behaviour is undefined: nothing detects a product of two nonzero denominators becoming zero.

Cite this page

The FLINT team, “gr_ctx_init_gr_fraction (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_fraction.html (generated 2026-10-20).