PHP. Руководство по PHP. 2005
gmp_gcdext
gmp_gcdext
Description
array gmp_gcdext (resource a, resource b)Calculates g, s, and t, such that a*s + b*t = g = gcd(a,b), where gcd is the greatest common divisor. Returns an array with respective elements g, s and t.
This function can be used to solve linear Diophantine equations in two variables. These are equations that allow only integer solutions and have the form: a*x + b*y = c. For more information, go to the "Diophantine Equation" page at MathWorld
gmp_gcd
gmp_hamdist