Logo

Programming-Idioms

History of Idiom 75 > diff from v27 to v28

Edit summary for version 28 by example12345:
New Cpp implementation by user [example12345]

Version 27

2019-09-27, 12:06:36

Version 28

2019-09-28, 16:53:05

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
#include <numeric>
Code
auto x = std::lcm(a, b);
Doc URL
https://en.cppreference.com/w/cpp/numeric/lcm
Origin
https://en.cppreference.com/w/cpp/numeric/lcm