swh:1:snp:77163734605b0ec556b01d897b7bb4a7e30d46b6
Raw File
Tip revision: 97bf6af1f928216fd6c5a66e8a57bfa95a659672 authored by Linus Torvalds on 21 December 2014, 01:08:50 UTC
Linux 3.19-rc1
Tip revision: 97bf6af
lcm.c
#include <linux/kernel.h>
#include <linux/gcd.h>
#include <linux/export.h>
#include <linux/lcm.h>

/* Lowest common multiple */
unsigned long lcm(unsigned long a, unsigned long b)
{
	if (a && b)
		return (a / gcd(a, b)) * b;
	else
		return 0;
}
EXPORT_SYMBOL_GPL(lcm);
back to top