View Single Post
Old Apr 8th, 2006, 9:59 PM   #7
Kaja Fumei
Hobbyist Programmer
 
Join Date: Oct 2005
Posts: 134
Rep Power: 4 Kaja Fumei is on a distinguished road
Quote:
Originally Posted by andro
The Euclidean algorithm is recursive, not to mention the same method he is using
True, but also on that page is the same algorithm written iteratively:
int gcd(int a, int b) {
  int t;
  while (b != 0) {
    t = b;
    b = a % b;
    a = t;
  }
  return a;
}
Kaja Fumei is offline   Reply With Quote