Home

lcm2

Lcm2 is a term used in mathematics and computing to denote the least common multiple of two integers. In many contexts it appears as a two-argument function named lcm2, distinguishing it from variants that compute the LCM of three or more numbers.

Definition and properties: For integers a and b, the least common multiple is lcm(a,b) = |a*b| / gcd(a,b).

Computing: In software libraries, lcm2 often implements the two-argument case using the gcd via Euclid's algorithm.

Usage and disambiguation: The term lcm2 is not universally standardized and may appear in different programming

See also: Least common multiple; Greatest common divisor; Euclidean algorithm; LCM (general).

The
value
is
the
smallest
positive
integer
divisible
by
both
a
and
b.
If
either
input
is
zero,
most
conventions
define
lcm(0,b)
=
0.
The
operation
is
commutative
and,
when
extended
to
sequences,
can
be
combined
associatively
with
respect
to
multiple
inputs.
Some
languages
provide
a
generic
LCM
function
that
accepts
a
list
of
numbers;
lcm2
is
then
a
specialized
alias
in
two-argument
form.
For
example,
lcm2(8,
12)
equals
24.
environments
or
educational
materials
to
denote
two-number
LCM.
When
encountering
lcm2,
it
is
advisable
to
check
the
specific
documentation
for
the
intended
meaning
and
any
edge
cases
for
zero
or
negative
inputs.