From 6:00 PM CST Friday, Feb 15th - 2:00 AM CST Sunday, Feb 17th, ni.com will be undergoing system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

From 6:00 PM CST Friday, Feb 15th - 2:00 AM CST Sunday, Feb 17th, ni.com will be undergoing system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

Last Modified: January 12, 2018

Computes the least common multiple of the input values.

An integer.

An integer.

Least common multiple of **x** and **y**.

**LCM(x,y)** is the smallest integer *m* for which there exist integers *c* and *d* such that

$x\times c=y\times d=m$

To compute **LCM(x,y)**, consider the prime factorizations of **x** and **y**:

$x=\underset{i}{\prod}{{p}_{i}}^{{a}_{i}}$

$y=\underset{i}{\prod}{{p}_{i}}^{{b}_{i}}$

where *p*_{i} are all the prime factors of **x** and **y**. If *p*_{i} does not occur in a factorization, the corresponding exponent is 0. **LCM(x,y)** then is given by:

$\mathrm{LCM}(x,y)=\underset{i}{\prod}{{p}_{i}}^{\mathrm{max}({a}_{i},{b}_{i})}$

The prime factorizations of 12 and 30 are given by:

$12={2}^{2}\times {3}^{1}\times {5}^{0}$

$30={2}^{1}\times {3}^{1}\times {5}^{1}$

so

$\mathrm{LCM}(12,30)={2}^{2}\times {3}^{1}\times {5}^{1}=60$

**Where This Node Can Run: **

Desktop OS: Windows

FPGA: Not supported

Web Server: Not supported in VIs that run in a web application