Merge branch 'BAEL-3283-latest' into BAEL-3283

This commit is contained in:
sandip singh
2019-10-31 23:25:14 +05:30
parent db85c8f275
commit f6c3f9ebcb
20562 changed files with 1643286 additions and 0 deletions
@@ -0,0 +1,13 @@
package com.baeldung.lcm;
import java.math.BigInteger;
public class BigIntegerLCM {
public static BigInteger lcm(BigInteger number1, BigInteger number2) {
BigInteger gcd = number1.gcd(number2);
BigInteger absProduct = number1.multiply(number2).abs();
return absProduct.divide(gcd);
}
}