FLINT3.7.0-dev

flint_mpn_is_square_mod

Synopsis#include <flint/mpn_extras.h>
int flint_mpn_is_square_mod(nn_srcptr a, nn_srcptr d, mp_size_t n)source

Returns 1 if a is a square modulo the odd prime d, and 0 if it is not. This evaluates the Jacobi symbol (a/d) with GMP, in quasi-linear time; a return value of 0 means that the symbol is -1, so it also proves that a is not a square for an odd d that is not prime, while a return value of 1 proves nothing in that case.

Cite this page

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