# lcm() Function & Examples

Use the lcm() arithmetic function in Calcul.io. Review its syntax, edit working examples, understand the result, and explore related math functions.

## lcm

#### lcm(x, y)

Try it yourself:

```calculio
lcm(4, 6)
lcm(6, 21)
lcm(6, 21, 5)
```

[gcd](https://calcul.io/function/gcd/index.md)

---

## lcm(): Least Common Multiple

**lcm()** returns the smallest positive integer divisible by each supplied integer. For example, lcm(6, 8) is 24. It is useful for synchronizing repeating cycles, finding a common denominator, and aligning periodic schedules.

## Integer inputs

lcm is defined for integer-style values; fractional measurements should be converted to an appropriate integer representation first. The result is closely related to [gcd()](https://calcul.io/function/gcd/index.md): for nonzero integers, lcm(a, b) × gcd(a, b) equals abs(a×b).

Use [abs()](https://calcul.io/function/abs/index.md) when interpreting a magnitude, and [rem()](https://calcul.io/function/rem/index.md) to verify divisibility. Large inputs can yield very large results, so avoid unnecessary conversion to floating-point values.

[All functions](https://calcul.io/functions/index.md)
