summaryrefslogtreecommitdiff
path: root/examples/gcd.c
diff options
context:
space:
mode:
authorAlex AUVOLAT <alex.auvolat@ens.fr>2014-04-30 17:19:08 +0200
committerAlex AUVOLAT <alex.auvolat@ens.fr>2014-04-30 17:19:08 +0200
commitbcde99fbe99174a094f38fdda70ad69d65a423f4 (patch)
tree21e16494aba19c4a63d55eba877abfe7fe5d8e80 /examples/gcd.c
downloadSemVerif-Projet-bcde99fbe99174a094f38fdda70ad69d65a423f4.tar.gz
SemVerif-Projet-bcde99fbe99174a094f38fdda70ad69d65a423f4.zip
Fist commit (WIP)
Diffstat (limited to 'examples/gcd.c')
-rw-r--r--examples/gcd.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/examples/gcd.c b/examples/gcd.c
new file mode 100644
index 0000000..1f66332
--- /dev/null
+++ b/examples/gcd.c
@@ -0,0 +1,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
+