FLINT3.7.0-dev

_gr_poly_set_length_normalise, _gr_poly_normalise

Synopsis#include <flint/gr_poly.h>
void _gr_poly_set_length_normalise(gr_poly_t poly, slong len, gr_ctx_t ctx)source
void _gr_poly_normalise(gr_poly_t poly, gr_ctx_t ctx)source

Set the length of poly to len (respectively keep the current length) and then decrease it while the leading coefficient is provably zero. This is the usual last step after an underscore function has written coefficients. Both call the ring method GR_METHOD_POLY_SET_LENGTH_NORMALISE, whose default gr_generic_poly_set_length_normalise zeroes the dropped coefficients like _gr_poly_set_length; rings with shallow elements (nmod, fmpz_mod, mpn_mod, nmod8, nmod32) override it to compute only the new length.

Guides#

Cite this page

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