Logo

Programming-Idioms

History of Idiom 75 > diff from v8 to v9

Edit summary for version 9 by :

Version 8

2015-08-23, 19:50:46

Version 9

2015-09-03, 16:37:52

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.

Code
x = a.lcm(b)
Doc URL
http://ruby-doc.org/core-2.2.3/Integer.html#method-i-lcm