FLINT3.7.0-dev

gr_mul_2exp_si, gr_mul_2exp_fmpz

Synopsis#include <flint/gr.h>
int gr_mul_2exp_si(gr_ptr res, gr_srcptr x, slong y, gr_ctx_t ctx)source
int gr_mul_2exp_fmpz(gr_ptr res, gr_srcptr x, const fmpz_t y, gr_ctx_t ctx)source

Set res to x \cdot 2^y. For negative y this divides by 2^{-y} (failing with GR_DOMAIN if the division is not possible), so it also works in rings where 2^y is not representable as an element but the quotient is.

Cite this page

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