FLINT3.7.0-dev

_gr_vec_set_powers

Synopsis#include <flint/gr_vec.h>
int _gr_vec_set_powers(gr_ptr res, gr_srcptr x, slong len, gr_ctx_t ctx)source

Sets res to the powers 1, x, x^2, \ldots, x^{len-1}.

The default multiplies by x repeatedly, except in finite rings and rings with a real precision, where it computes even powers by squaring (x^{2k} = (x^k)^2, x^{2k+1} = x^{k+1} x^k), which reduces the error growth of floating-point and ball arithmetic.

Cite this page

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