fmpz, fmpz_t
#include <flint/fmpz.h>fmpzfmpz_tAn 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#
- Getting started with arb (
arb) - Decimal ball arithmetic (
decimal) - Ball semantics, nonfinite values and domains (
dfloat) - Multiplying integers and polynomials (
fft) - Canonical form and the fmpq interface (
fmpq) - Getting started with fmpq_poly (
fmpq_poly) - Getting started with fmpz
- The fmpz representation
- Exact linear algebra over the integers (
fmpz_mat) - Using fmpz_mod (
fmpz_mod) - Prime and composite moduli (
fmpz_mod_mat) - Getting started with fmpz_mod_poly (
fmpz_mod_poly) - Getting started with fmpz_mpoly (
fmpz_mpoly) - Getting started with fmpz_poly (
fmpz_poly) - Getting started with finite fields (
fq_default) - Getting started with generic rings (
gr) - Implementing a ring (
gr) - Getting started (
gr_dft) - Using mpn_mod (
mpn_mod) - Rounding in nfloat (
nfloat) - Getting started with nmod_mpoly (
nmod_mpoly) - Computing modulo a fixed polynomial (
nmod_poly) - Precision in the padic module (
padic) - Computing in the class group (
qfb) - Arithmetic in radix b^e (
radix)
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).
@misc{flint-doc-fmpz-fmpz,
author = {{The FLINT team}},
title = {{fmpz, fmpz\_t (fmpz.h)}},
howpublished = {FLINT: Fast Library for Number Theory, documentation, version 3.7.0-dev},
year = {2026},
url = {https://flintlib.org/doc/fmpz/fmpz.html},
note = {Generated 2026-10-20}
}