The gmp_jacobi()function calculates the Jacobi symbol of two GMP numbers.
Syntax
gmp_jacobi($n1, $n2)
Parameters
n1 − The first GMP number. It can be GMP object in PHP version 5.6 and later. Can also be numeric strings.
n2 − The second GMP number. It can be GMP object in PHP version 5.6 and later. Can also be numeric strings.
Return
The gmp_jacobi() function returns the GMP number or object. The return value would be the jacobi of the numbers.
Example
The following is an example −
<?php $n1 = gmp_init(2); $n2 = gmp_init(3); $a = gmp_jacobi($n1, $n2); echo $a; ?>
Output
The following is the output −
-1