lcm ( a b -- c )


Vocabulary
math

Inputs
aan integer
ban integer


Outputs
can integer


Word description
Computes the least common multiple of a and b. If either of the arguments is zero, then the returned value is zero.

Examples
USING: math prettyprint ; 10 5 lcm .
10

USING: math prettyprint ; 10 3 lcm .
30

USING: math prettyprint ; 10 8 lcm .
40

USING: math prettyprint ; 10 0 lcm .
0

USING: math prettyprint ; 0 0 lcm .
0

USING: math prettyprint ; 1/3 1/6 lcm .
1/3


Definition