FLINT3.7.0-dev

_nmod_pow_ui_binexp, _nmod_pow_ui_binexp_halflimb, _nmod_pow_ui_redc, _nmod_pow_ui_redc_half, _nmod_2_pow_ui_binexp

Synopsis#include <flint/nmod.h>
ulong _nmod_pow_ui_binexp(ulong a, ulong exp, nmod_t mod)source
ulong _nmod_pow_ui_binexp_halflimb(ulong a, ulong exp, nmod_t mod)source
ulong _nmod_pow_ui_redc(ulong a, ulong exp, nmod_t mod)source
ulong _nmod_pow_ui_redc_half(ulong a, ulong exp, nmod_t mod)source
ulong _nmod_2_pow_ui_binexp(ulong exp, nmod_t mod)source

The algorithms behind nmod_pow_ui and nmod_2_pow_ui, with the same results. The first four require exp≥1\mathit{exp} \ge 1 (they do not terminate for exp=0\mathit{exp} = 0). _nmod_pow_ui_binexp_halflimb requires n≤2FLINT_BITS/2n \le 2^{\mathtt{FLINT\_BITS} / 2}, _nmod_pow_ui_redc odd nn, and _nmod_pow_ui_redc_half odd n<2FLINT_BITS/2−2n < 2^{\mathtt{FLINT\_BITS} / 2 - 2}. _nmod_2_pow_ui_binexp accepts any nn and any exponent.

Cite this page

The FLINT team, “_nmod_pow_ui_binexp, _nmod_pow_ui_binexp_halflimb, _nmod_pow_ui_redc, _nmod_pow_ui_redc_half, _nmod_2_pow_ui_binexp (nmod.h),” FLINT: Fast Library for Number Theory, documentation, version 3.7.0-dev, 2026. https://flintlib.org/doc/nmod/_nmod_pow_ui_binexp.html (generated 2026-11-20).