legendre#

Return the Legendre symbol ($m / $n) as -1, 0, or 1.

Synopsis#

Math::GMP->new(6)->legendre(Math::GMP->new(11));   # -1, 0, or 1

Defined only when $n is an odd prime. When $n is not an odd prime the result is currently 0, but do not rely on that — upstream documents this as “may change in the future”.