-
-
Notifications
You must be signed in to change notification settings - Fork 18
lcm
Vašek edited this page Feb 7, 2019
·
3 revisions
This function returns the least common multiple of the given numbers
lcm(n,x)
Argument | Description |
---|---|
int n |
First number |
int x |
The other number |
Returns: int
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.
int value = lcm(5, 3);
This function sets value
to 15.
Back to number_functions