FLINT3.7.0-dev

nmod_redc_half_set_nmod, nmod_redc_half_set_ui, nmod_redc_half_get_nmod

Synopsis#include <flint/nmod.h>
ulong nmod_redc_half_set_nmod(ulong x, const nmod_redc_ctx_t ctx)source
ulong nmod_redc_half_set_ui(ulong x, const nmod_redc_ctx_t ctx)source
ulong nmod_redc_half_get_nmod(ulong x, const nmod_redc_ctx_t ctx)source

Convert to and from Montgomery form with R = 2^{\mathtt{FLINT\_BITS}/2}. nmod_redc_half_set_nmod requires x < n and nmod_redc_half_set_ui accepts any x. nmod_redc_half_get_nmod returns a value in [0, n) for any x < nR, in particular for lazy residues.

Guides#

Cite this page

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