UNPKG
ts-ds-tool
Version:
latest (0.1.5)
0.1.5
0.1.4
0.1.3
0.1.2
0.1.1
0.1.0
Data structure and algorithm of TypeScript
github.com/HaifengDu/ts-ds-tool
HaifengDu/ts-ds-tool
ts-ds-tool
/
resource
/
math
/
leastCommonMultiple.js
6 lines
(5 loc)
•
184 B
JavaScript
View Raw
1
2
3
4
5
6
import
{ gcd }
from
"./greatestCommonDivisor"
;
export
function
lcm
(
num1, num2
) {
var
gcdResult =
gcd
(num1, num2);
return
gcdResult * (num1 / gcdResult) * (num2 / gcdResult); }