Trusted answers to developer questions
Trusted Answers to Developer Questions

Related Tags

php
gmp_jacobi
communitycreator

What is gmp_jacobi in PHP?

Hammad Nasir

Grokking Modern System Design Interview for Engineers & Managers

Ace your System Design Interview and take your career to the next level. Learn to handle the design of applications like Netflix, Quora, Facebook, Uber, and many more in a 45-min interview. Learn the RESHADED framework for architecting web-scale applications by determining requirements, constraints, and assumptions before diving into a step-by-step design process.

gmp_jacobi is a function in PHP that finds the Jacobi symbol 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";
?>

RELATED TAGS

php
gmp_jacobi
communitycreator

Grokking Modern System Design Interview for Engineers & Managers

Ace your System Design Interview and take your career to the next level. Learn to handle the design of applications like Netflix, Quora, Facebook, Uber, and many more in a 45-min interview. Learn the RESHADED framework for architecting web-scale applications by determining requirements, constraints, and assumptions before diving into a step-by-step design process.

Keep Exploring