FLINT3.7.0-dev

gr_generic_pow_ui_binexp, gr_generic_pow_fmpz_binexp

Synopsis#include <flint/gr_generic.h>
int gr_generic_pow_ui_binexp(gr_ptr res, gr_srcptr x, ulong e, gr_ctx_t ctx)source
int gr_generic_pow_fmpz_binexp(gr_ptr res, gr_srcptr x, const fmpz_t exp, gr_ctx_t ctx)source

Compute x^e for e \ge 0 by left-to-right binary exponentiation, with special code for e \le 4; gr_generic_pow_fmpz_binexp returns GR_DOMAIN for negative e. The output may alias the input.

Cite this page

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