FLINT3.7.0-dev

n_CRT

Synopsis#include <flint/ulong_extras.h>
ulong n_CRT(ulong r1, ulong m1, ulong r2, ulong m2)source

Returns the unique 0≤x<m1m20 \le x < m_1 m_2 with x≡r1(modm1)x \equiv r_1 \pmod{m_1} and x≡r2(modm2)x \equiv r_2 \pmod{m_2}. Requires coprime m1,m2>1m_1, m_2 > 1 with m1m2m_1 m_2 fitting in a ulong, and reduced r1,r2r_1, r_2. Nothing is checked.

Cite this page

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