FLINT3.7.0-dev

_fmpq_add_small, _fmpq_mul_small

Synopsis#include <flint/fmpq.h>
void _fmpq_add_small(fmpz_t rnum, fmpz_t rden, slong p1, ulong q1, slong p2, ulong q2)source
void _fmpq_mul_small(fmpz_t rnum, fmpz_t rden, slong p1, ulong q1, slong p2, ulong q2)source

Set (rnum, rden) to the canonical sum or product of p_1/q_1 and p_2/q_2, which must be canonical with all four values of absolute value at most COEFF_MAX (that is, small fmpz values). The intermediate results are computed in two words. These are the fast paths of the general functions.

Guides#

Cite this page

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