https://jxself.org/git/linux-libre.git
Raw File
Tip revision: aa95e7da9dfa2cbf38c2cc7936112aac7acbac2c authored by Jason Self on 19 May 2013, 17:06:01 UTC
Linux-libre 3.0.79-gnu1
Tip revision: aa95e7d
lcm.c
#include <linux/kernel.h>
#include <linux/gcd.h>
#include <linux/module.h>

/* Lowest common multiple */
unsigned long lcm(unsigned long a, unsigned long b)
{
	if (a && b)
		return (a * b) / gcd(a, b);
	else if (b)
		return b;

	return a;
}
EXPORT_SYMBOL_GPL(lcm);
back to top