PHP gmp_legendre() FunctionPHP 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. SyntaxThe following syntax shows gmp_legendre() function and its operation. ExamplesThe 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. 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. 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. 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. ConclusionAccording 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. Next TopicPHP gmp_mod() Function |