Logo

Programming-Idioms

History of Idiom 75 > diff from v19 to v20

Edit summary for version 20 by Elronnd:
New D implementation by user [Elronnd]

Version 19

2017-02-07, 22:54:44

Version 20

2017-07-26, 00:43:44

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 std.numeric: gcd
Code
uint x = (a * b) / gcd(a, b);