Logo

Programming-Idioms

History of Idiom 75 > diff from v30 to v31

Edit summary for version 31 by Wiseguy:
New Java implementation by user [Wiseguy]

Version 30

2019-10-14, 12:27:13

Version 31

2019-10-17, 03:24:59

Idiom #75 Compute LCM

Compute the least common multiple x of big integers a and b. Use an integer type able to handle huge numbers.

Idiom #75 Compute LCM

Compute the least common multiple x of big integers a and b. Use an integer type able to handle huge numbers.

Imports
import java.math.BigInteger;
Code
x = a.multiply(b).divide(a.gcd(b));