FLINT3.7.0-dev

COEFF_TO_PTR, PTR_TO_COEFF

Synopsis#include <flint/fmpz.h>
mpz_ptr COEFF_TO_PTR(fmpz f)source
fmpz PTR_TO_COEFF(mpz_ptr ptr)source

Macros converting between an fmpz that holds a pointer and the mpz_ptr itself. PTR_TO_COEFF shifts the pointer right by two bits and sets the tag bits 01; this relies on mpz_structs being aligned to at least four bytes. COEFF_TO_PTR must only be applied to values for which COEFF_IS_MPZ is true.

FMPZ_TO_ZZ performs the same conversion for code that does not include gmp.h.

Guides#

Cite this page

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