PHP GMP Functions Complete Reference Read Courses Improve Improve Improve Like Article Like Save Article Save Report issue Report The GMP function uses arbitrary-length integers to perform mathematical operations. The GMP function contains the GMP number as an argument. Example: Program to perform the division of GMP numbers when numeric strings as GMP numbers are passed as arguments. PHP <?php// PHP program to perform division of// GMP numbers passed as arguments // strings as GMP numbers$num1 = "-6";$num2 = "2"; // calculates the quotient when// $num1 is divided by $num2$quo = gmp_div_q($num1, $num2); echo $quo;?> Output: -3 The complete list of GMP functions are given below: PHP GMP Function Description gmp_abs()Calculate the absolute value of a GMP number gmp_add()It is used to add two GMP numbers.gmp_clrbit()The gmp_clrbit() function sets the bit at a specified index in a GMP number to 0. gmp_cmp()Compare two GMP numbers.gmp_com()Calculate the oneâs complement of a GMP numbergmp_div_q()Perform the division of GMP numbers(gmp_div_qr()The division operation between two GMP numbersgmp_div_r()Performs the division operation between two GMP numbersgmp_divexact()Check whether a GMP numbergmp_export()That exports to a binary string.gmp_fact()Calculate the factorial of a GMP numbergmp_gcd()Calculate the GCD of 2 GMP numbers gmp_gcdext()Calculates the GCD and and multipliers of a given equationgmp_hamdist()Find the hamming distance between two GMP numbers gmp_import()That imports a GMP numbgmp_intval()Converts a GMP number to an integer.gmp_invert()Find the modular inverse of a GMP numbergmp_jacobi()Computes the Jacobi symbol of two GMP numbersgmp_legendre()Computes the Legendre symbol of two GMP numbersgmp_mod()Find the modulo of a GMP number(gmp_mul()It is used to multiply two GMP numbgmp_neg()Returns the negative of a GMP numbergmp_nextprime()Calculate the prime number just greater than a given GMP numbergmp_perfect_square()Checks if the given GMP numbergmp_popcount()Find the population count of a GMP number gmp_pow() Calculate the power raised to a number of a GMP number and an integer gmp_prob_prime()Check how much the possibility of a given GMP numbergmp_random_bits()Generates a random number. gmp_random_range() Generated lies between the range min to max. gmp_random_seed()Sets the RNG to seegmp_root()Returns the integer part of the N-th root of a GMP numbergmp_rootrem()Calculate the nth root of a GMP number (GNU Multiple Precision: For large numbers)gmp_scan0() FunIt is used to scan â0â in a GMP numbgmp_scan1()It is used to scan â1â in the GMP numbergmp_setbit()Set the bit index in the given $num.gmp_sign()Checks the sign of a given GMP numbergmp_sqrt()Calculate the square root of a GMP numbergmp_sqrtrem()Calculate the square root of a GMP numbergmp_strval()Returns the string value of a GMP number.gmp_sub()Returns the subtraction of the two GMP numbers.gmp_testbit()Checks if the specified bit of a given GMP numbergmp_xor()Calculate the XOR of 2 GMP numbersgmp_random()Random numbers will be between zero and the number of bits per limb Whether you're preparing for your first job interview or aiming to upskill in this ever-evolving tech landscape, GeeksforGeeks Courses are your key to success. We provide top-quality content at affordable prices, all geared towards accelerating your growth in a time-bound manner. Join the millions we've already empowered, and we're here to do the same for you. Don't miss out - check it out now! Last Updated : 24 Jan, 2023 Like Article Save Article Previous PHP Gmagick Functions Complete Reference Next PHP Ds\Set Functions Complete Reference Share your thoughts in the comments Add Your Comment Please Login to comment...