fmpq_simplest_between, _fmpq_simplest_between
Synopsis
#include <flint/fmpq.h>void _fmpq_simplest_between(fmpz_t x_num, fmpz_t x_den, const fmpz_t l_num, const fmpz_t l_den, const fmpz_t r_num, const fmpz_t r_den)sourceSet to the simplest fraction in the closed interval between and , where is simpler than if , or and . The endpoints need not be canonical, but their denominators must be positive; the result is canonical.
fmpq_simplest_between accepts the endpoints in either order; the underscore version requires . The simplest fraction is read off the common prefix of the continued fraction expansions of the endpoints, computed by _fmpq_ball_get_cfrac; see Continued fractions of rational numbers.
Cite this page
The FLINT team, “fmpq_simplest_between, _fmpq_simplest_between (fmpq.h),” FLINT: Fast Library for Number Theory, documentation, version 3.7.0-dev, 2026. https://flintlib.org/doc/fmpq/fmpq_simplest_between.html (generated 2026-11-02).
@misc{flint-doc-fmpq-fmpq-simplest-between,
author = {{The FLINT team}},
title = {{fmpq\_simplest\_between, \_fmpq\_simplest\_between (fmpq.h)}},
howpublished = {FLINT: Fast Library for Number Theory, documentation, version 3.7.0-dev},
year = {2026},
url = {https://flintlib.org/doc/fmpq/fmpq_simplest_between.html},
note = {Generated 2026-11-02}
}