Skip to content
Vašek edited this page Feb 7, 2019 · 3 revisions

lcm

This function returns the least common multiple of the given numbers

Syntax:

lcm(n,x)
Argument Description
int n First number
int x The other number

Returns: int

Description:

The least common multiple of two numbers is the smallest positive integer that is divisible by both a and b. For exapmle: What is the least common multiple of 4 and 6?

Multiples of 4 are:

Multiples of 6 are:

Common multiples are:

So their least common multiple is 12.

Example:

int value = lcm(5, 3);

This function sets value to 15.

Back to number_functions

Clone this wiki locally