FLINT3.7.0-dev

fmpq_gcd_cofactors, _fmpq_gcd_cofactors

Synopsis#include <flint/fmpq.h>
void fmpq_gcd_cofactors(fmpq_t g, fmpz_t abar, fmpz_t bbar, const fmpq_t a, const fmpq_t b)source
void _fmpq_gcd_cofactors(fmpz_t gnum, fmpz_t gden, fmpz_t abar, fmpz_t bbar, const fmpz_t anum, const fmpz_t aden, const fmpz_t bnum, const fmpz_t bden)source

Set g = \gcd(a, b) as in fmpq_gcd and the coprime integer cofactors \bar a = a/g and \bar b = b/g. If a = b = 0, then g = 0 and \bar a = \bar b = 0. Unlike _fmpq_gcd, the inputs must be canonical.

Cite this page

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