Trusted answers to developer questions
Trusted Answers to Developer Questions

Related Tags

php
gmp_legendre
communitycreator

What is gmp_legendre 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_legendre is a function in PHP that finds out the Legendre symbol of the arguments passed.

Syntax


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

Parameters

The function takes in two parameters:

  • num1
  • num2

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


Return value

The function returns the Legendre symbol of num1 and num2.

Code

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

RELATED TAGS

php
gmp_legendre
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