FLINT3.7.0-dev

_fmpq_cmp, _fmpq_cmp_fmpz, _fmpq_cmp_si, _fmpq_cmp_ui

Synopsis#include <flint/fmpq.h>
int _fmpq_cmp(const fmpz_t p, const fmpz_t q, const fmpz_t r, const fmpz_t s)source
int _fmpq_cmp_fmpz(const fmpz_t p, const fmpz_t q, const fmpz_t r)source
int _fmpq_cmp_si(const fmpz_t p, const fmpz_t q, slong c)source
int _fmpq_cmp_ui(const fmpz_t p, const fmpz_t q, ulong c)source

Compare p/q with r/s, r or c, returning a negative value, zero or a positive value. The denominators must be positive; the fractions need not be in lowest terms.

Guides#

Cite this page

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