summaryrefslogtreecommitdiff
path: root/examples/gcd.c
blob: 1f66332d2ef8229bc5e87a9be6f59661a2ec5c9c (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
a = -26134272;
b = 26396928;

if (a < 0) a = -a;
if (b < 0) b = -b;
while (b > 0) {  // try changing this to b >= 0
  tmp = b;
  b = a % b;
  a = tmp;
 }
print (a); // this should print 131328