FLINT3.7.0-dev

fmpz, fmpz_t

Synopsis#include <flint/fmpz.h>
fmpz
fmpz_t

An fmpz is an slong. If its two most significant bits are equal (00 or 11), it is an integer x with |x| \le COEFF_MAX, stored directly. If they are 01, the remaining bits hold a pointer to an mpz_struct shifted right by two bits, and the value is that of the mpz. An fmpz_t is an array of one fmpz, so that it is passed by reference like an mpz_t. A pointer fmpz * to an entry of an array can be passed wherever an fmpz_t is expected.

Every fmpz must be initialised (fmpz_init, or a zero word) before use and cleared afterwards (fmpz_clear), since a large value owns memory. An array of integers is an array of fmpz, usually created with _fmpz_vec_init and freed with _fmpz_vec_clear; see Arrays of integers. The representation is described in The fmpz representation.

Guides#

Cite this page

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