Javatpoint Logo
Javatpoint Logo

PHP gmp_legendre() Function

PHP language uses function called gmp_legendre() for the mathematical operation. This function figures out the Legendre symbol of two GMP numbers. The function needs two parameters, and the second parameter takes a value that is both odd and positive.

Syntax

The following syntax shows gmp_legendre() function and its operation.

Examples

The following example shows the Legendre symbol of different numbers and GMP parameters. According to the input value, the symbol shows in a 1, 0, and -1 format.

Example1: the given example uses the gmp_legendre() with the essential values.

Output:

The image shows the "Legendre symbol" of the given two values.

PHP gmp_legendre() Function

Example2: the given example uses the gmp_legendre() with the positive and negative values.

Output:

The image shows the "Legendre symbol" of the given two values.

PHP gmp_legendre() Function

Example3: the given an example uses the gmp_legendre() with the variable values.

Output:

The image shows the "Legendre symbol" of the given two values.

PHP gmp_legendre() Function

Example4: the following example shows the gmp_legendre() function with the GMP parameter and its value.

Output:

The image shows the "Legendre symbol" of the given two values.

PHP gmp_legendre() Function

Conclusion

According to the input data, the gmp_legendre() function shows the Legendre value. It shows 1, 0, and -1 values without need of complex mathematical operations and lengthy processes.







Youtube For Videos Join Our Youtube Channel: Join Now

Feedback


Help Others, Please Share

facebook twitter pinterest

Learn Latest Tutorials


Preparation


Trending Technologies


B.Tech / MCA