FLINT3.7.0-dev

fmpq_set_mpq, fmpq_get_mpq, fmpq_get_mpz_frac

Synopsis#include <flint/fmpq.h>
void fmpq_set_mpq(fmpq_t dest, const mpq_t src)source
void fmpq_get_mpq(mpq_t dest, const fmpq_t src)source
void fmpq_get_mpz_frac(mpz_t a, mpz_t b, fmpq_t c)source

Convert from and to GMP rationals; fmpq_get_mpz_frac sets a and b to the numerator and denominator of c. The value is copied as it is, without canonicalisation. These functions are declared only if gmp.h is included before any FLINT header.

Guides#

Cite this page

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