In arithmetic and number theory, the least common multiple (also known lowest common multiple or smallest common multiple) of two integers a and b, usually denoted by LCM(a, b), is the smallest positive integer that is divisible by both a and b.
For example, LCM(2,3) = 6 and LCM(6,10) = 30.
If a = 0 or b = 0, then return with LCM(a, b) = 0, else go to Step 2.
Calculate absolute values of the two numbers.
Initialize lcm as the higher of the two values computed in Step 2.
If lcm is divisible by both absolute values, then return.
Increment lcm by 1 and go to Step 4.