Php/docs/function.gmp-legendre
来自菜鸟教程
gmp_legendre
(PHP 4 >= 4.0.4, PHP 5, PHP 7)
gmp_legendre — Legendre symbol
说明
Compute the
[http://primes.utm.edu/glossary/page.php?sort=LegendreSymbol »
Legendre symbol] of a and
p. p should be odd
and must be positive.
参数
aPHP 5.5 之前为 GMP 数值资源,PHP 5.6 之后为 GMP 对象或数字,或可以转为数字的字符串。
pPHP 5.5 之前为 GMP 数值资源,PHP 5.6 之后为 GMP 对象或数字,或可以转为数字的字符串。
Should be odd and must be positive.
范例
Example #1 gmp_legendre() example
<?phpecho gmp_legendre("1", "3") . "\n";echo gmp_legendre("2", "3") . "\n";?>
以上例程会输出:
1 0