```{index} single: legendre; Math::GMP function ``` ```{index} single: Math::GMP::legendre; Perl function ``` # legendre Return the Legendre symbol `($m / $n)` as `-1`, `0`, or `1`. ## Synopsis ```perl 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".