MathPHP\Algebra::lcm PHP Method

lcm() public static method

For example, the LCM of 5 and 2 is 10. https://en.wikipedia.org/wiki/Least_common_multiple |a ⋅ b| lcm(a, b) = --------- gcd(a, b)
public static lcm ( integer $a, integer $b ) : integer
$a integer
$b integer
return integer
    public static function lcm(int $a, int $b) : int
    {
        // Special case
        if ($a === 0 || $b === 0) {
            return 0;
        }
        return abs($a * $b) / Algebra::gcd($a, $b);
    }