number_isprime Number number_mersenne

Number >> Number > number_lcm

number_lcm

Least common multiple.

Calling Sequence

result = number_lcm ( m , n )
result = number_lcm ( m , n , method )

Parameters

m :

a 1x1 matrix of floating point integers

n :

a 1x1 matrix of floating point integers

method :

a 1x1 matrix of strings, the algorithm to use (default method="euclidian")

result :

a 1x1 matrix of floating point integers, the least common multiple

Description

Returns the least common multiple of m and n. Uses number_gcd. The values of the method variable are the same as the values in number_gcd.

Examples

// Test without options
computed = number_lcm ( 4 , 6 ) // 12
computed = number_lcm ( 6 , 4 ) // 12
// Test with euclidian
computed = number_lcm ( 4 , 6 , "euclidian" ) // 12
computed = number_lcm ( 6 , 4 , "euclidian" ) // 12

// With negative integers
computed = number_lcm ( 4 , -6 ) // 12

Authors

number_isprime Number number_mersenne