FLINT3.7.0-dev

gr_gcd, gr_lcm

Synopsis#include <flint/gr.h>
int gr_gcd(gr_ptr res, gr_srcptr x, gr_srcptr y, gr_ctx_t ctx)source
int gr_lcm(gr_ptr res, gr_srcptr x, gr_srcptr y, gr_ctx_t ctx)source

Set res to a greatest common divisor, respectively least common multiple, of x and y. These are unique only up to units; the ring chooses a representative, typically the canonical associate (nonnegative in \mathbb{Z}, monic in F[x], 1 or 0 in a field).

Cite this page

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