FLINT3.7.0-dev

fmpq_init_set_readonly, fmpq_clear_readonly

Synopsis#include <flint/fmpq.h>
void fmpq_init_set_readonly(fmpq_t f, const mpq_t z)source
void fmpq_clear_readonly(fmpq_t f)source

Make the uninitialised fmpq_t f a read-only view of the mpq_t z, and release it. z must not change while f is in use, and f must not be modified. fmpq_init_set_readonly is declared only if gmp.h is included before any FLINT header.

The intended use is to call FLINT functions on GMP rationals:

mpq_t z;
...
{
    fmpq_t f;

    fmpq_init_set_readonly(f, z);
    foo(..., f);
    fmpq_clear_readonly(f);
}
Cite this page

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