COEFF_TO_PTR, PTR_TO_COEFF
Synopsis
#include <flint/fmpz.h>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).
@misc{flint-doc-fmpz-COEFF-TO-PTR,
author = {{The FLINT team}},
title = {{COEFF\_TO\_PTR, PTR\_TO\_COEFF (fmpz.h)}},
howpublished = {FLINT: Fast Library for Number Theory, documentation, version 3.7.0-dev},
year = {2026},
url = {https://flintlib.org/doc/fmpz/COEFF_TO_PTR.html},
note = {Generated 2026-10-20}
}