FLINT3.7.0-dev

gr_generic_set_fmpz_2exp_fmpz, gr_generic_get_fmpz_2exp_fmpz

Synopsis#include <flint/gr_generic.h>
int gr_generic_set_fmpz_2exp_fmpz(gr_ptr res, const fmpz_t x, const fmpz_t y, gr_ctx_t ctx)source
int gr_generic_get_fmpz_2exp_fmpz(fmpz_t res1, fmpz_t res2, gr_ptr x, gr_ctx_t ctx)source

Set res to x \cdot 2^y by powering 2 in the ring, respectively write x as m \cdot 2^e with m odd by converting it to a rational number with gr_get_fmpq (failing with GR_DOMAIN if its denominator is not a power of 2).

Cite this page

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