FLINT3.7.0-dev

nmod_addmul, nmod_fmma

Synopsis#include <flint/nmod.h>
ulong nmod_addmul(ulong s, ulong a, ulong b, nmod_t mod)source
ulong nmod_fmma(ulong a, ulong b, ulong c, ulong d, nmod_t mod)source

Return s+abs + ab and ab+cdab + cd modulo nn, for reduced operands. nmod_addmul forms s+abs + ab as a two-word integer and reduces it once. nmod_fmma does the same with ab+cdab + cd when n<2FLINT_BITS−1n < 2^{\mathtt{FLINT\_BITS} - 1} (the sum is then below 2n2<nB2n^2 < nB); for larger nn it reduces abab first.

Guides#

Cite this page

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