Quantcast
Channel: Programming Forums
Viewing all articles
Browse latest Browse all 51036

Iterative Euclid algorithm

$
0
0
Hello guys,
so this is a code snippt i found online, i just wanted to know wether its in C or C++
and how do i read the last line? i cannot seem to understand it
Thanks!

int gcd_iter(int u, int v) {
  int t;
  while (v) {
    t = u; 
    u = v; 
    v = t % v;
  }
  return u < 0 ? -u : u; /* abs(u) */
}

Viewing all articles
Browse latest Browse all 51036

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>