src/Math.php
public static function gcd($a, $b)
    {
        $ta = abs($a);
        $tb = abs($b);
        while ($tb != 0) {
            $tmp = $tb;
            $tb = $ta % $tb;
            $ta = $tmp;
        }
        
        return $ta;
    }
public static function gcd($a, $b)
    {
        $ta = abs($a);
        $tb = abs($b);
        while ($tb != 0) {
            $tmp = $tb;
            $tb = $ta % $tb;
            $ta = $tmp;
        }
        
        return $ta;
    }
public static function gcd ( $ a , $ b ) { $ ta = abs ( $ a ) ; $ tb = abs ( $ b ) ; while ( $ tb != 0 ) { $ tmp = $ tb ; $ tb = $ ta % $ tb ; $ ta = $ tmp ; } return $ ta ; }
Computes the greatest common divisor.

Uses the Euclidean algorithm.

@param int $a
@param int $b

@return int the greatest common divisor
Computes the greatest common divisor .