|
Lowest Common Multiple (LCM)
|
|
01-13-2010, 07:22 AM
(This post was last modified: 01-13-2010 07:23 AM by drdebcol.)
Post: #1
|
|||
|
|||
|
Lowest Common Multiple (LCM)
I have explained what is Greatest Common Divisor (GCD) before.
You have Euclidean algorithm for GCD used in this two tasks : http://www.pro9ramming.com/the-biggest-gcd-t-596.html http://www.pro9ramming.com/euclid-problem-t-189.html And you have Binary algorithm for GCD here : http://www.pro9ramming.com/binary-gcd-al...t-916.html Lowest Common Multiple and Greatest Common Divisor (GCD) are two important number properties, and they are interrelated. Even though GCD is more often used than LCM, it is useful to learn LCM too. You can express LCM over GCD like this : Code: LCM(m,n)=(m*n)/GCD(m,n)Code: LCM(6,4)=12Code: function gcd(m,n:longint):longint;Code: int gcd(int a, int b)There's a fine line between genius and insanity. I have erased this line. Oscar Levant There's a fine line between an administrator and black hat hacker. I have erased this line. Dr DEBCOL |
|||
|
01-13-2010, 07:40 AM
Post: #2
|
|||
|
|||
|
RE: Lowest Common Multiple (LCM)
very nice.
|
|||
|
01-14-2010, 05:44 AM
Post: #3
|
|||
|
|||
|
RE: Lowest Common Multiple (LCM)
There's a fine line between genius and insanity. I have erased this line. Oscar Levant There's a fine line between an administrator and black hat hacker. I have erased this line. Dr DEBCOL |
|||
|
01-14-2010, 06:06 AM
(This post was last modified: 01-14-2010 06:06 AM by Alphablend.)
Post: #4
|
|||
|
|||
|
RE: Lowest Common Multiple (LCM)
yeah,nice code.
|
|||
|
« Next Oldest | Next Newest »
|






![[Image: pgsig copy.png]](http://projectghostt.com/images/pgsig copy.png)
