From 871480933a1c28f8a9fed4c4d34d06c439a7a422 Mon Sep 17 00:00:00 2001 From: Srikant Patnaik Date: Sun, 11 Jan 2015 12:28:04 +0530 Subject: Moved, renamed, and deleted files The original directory structure was scattered and unorganized. Changes are basically to make it look like kernel structure. --- lib/gcd.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 lib/gcd.c (limited to 'lib/gcd.c') diff --git a/lib/gcd.c b/lib/gcd.c new file mode 100644 index 00000000..cce4f3cd --- /dev/null +++ b/lib/gcd.c @@ -0,0 +1,18 @@ +#include +#include +#include + +/* Greatest common divisor */ +unsigned long gcd(unsigned long a, unsigned long b) +{ + unsigned long r; + + if (a < b) + swap(a, b); + while ((r = a % b) != 0) { + a = b; + b = r; + } + return b; +} +EXPORT_SYMBOL_GPL(gcd); -- cgit