0
$\begingroup$

Recently, I've learned how to solve diophantine linear equations (i.e. of form $ax + by = c$) using euclidean algorithm. I am wondering about how big $x$ and $y$ can get in terms of $a, b, c$. Are there any estimates?

  • 0
    If the equation has one solution, it has infnitely many, so there's no bound on $x$ and $y$.2017-02-07
  • 0
    Oh, sorry. I meant the $x, y$ after performing euclidean algorithm. I know that there are infinitely many solutions, but my problem is that I want to write a program which would solve linear diophantine equation and I don't know if $x, y$ would overflow, because I have only 64-bit variables available.2017-02-07
  • 1
    OK. Let $d=\gcd(a,b,c)$. Then Euclid will give you a solution of $ax+by=d$ with $|x|<|b|$ and $|y|<|a|$. Then multiply by $|c/d|$.2017-02-07

0 Answers 0