What is gmp_jacobi in PHP?

gmp_jacobi is a function in PHP that finds the Jacobi symbolhttps://t5k.org/glossary/page.php?sort=JacobiSymbol of the passed arguments.

Syntax


gmp_jacobi(GMP|int|string $num1, GMP|int|string $num2): int

Parameters

The function takes two parameters: num1 and num2.


num1 and num2 can be a numeric string, GMP object, or the int type.


num2 must be positive and should not be an even number.


Return value

The function returns the Jacobi symbol of num1 and num2.

The value returned is of the int type.

Code

<?php
$result = gmp_jacobi("1", "3") ;
echo $result . "\n";
?>

Free Resources