A small tool for calculating the least common multiple (LCM) of two numbers. The least common multiple l of x,y is the smallest number such that there exists two integers m,n, such that l = mx and l = ny. Or in other words the smallest number which both x and y are factors of.
To use the tool just enter the numbers and press enter.
I am calculating lcm as lcm(x,y) = xy/gcd(x,y), where gcd is the greatest common divisor. I calculate gcd with Euclid’s algorithm which is an efficient algorithm for calculating the Greatest Common Divisor (GCD).
The C# equivalent of the source code for the GCD is explained in my solution to problem 9 of Project Euler, otherwise just peek at the source code for this page, there is nothing secret about it.