public static function gcd($a, $b)
    {
        $sign = 1;
        if ($a < 0) $sign = -$sign;
        if ($b < 0) $sign = -$sign;

        while ($b != 0)
        {
            $m = $a % $b;
            $a = $b;
            $b = $m;
        }
        return $sign*abs($a);
    }
public static function gcd($a, $b)
    {
        $sign = 1;
        if ($a < 0) $sign = -$sign;
        if ($b < 0) $sign = -$sign;

        while ($b != 0)
        {
            $m = $a % $b;
            $a = $b;
            $b = $m;
        }
        return $sign*abs($a);
    }
public static function gcd ( $ a , $ b ) { $ sign = 1 ; if ( $ a < 0 ) $ sign = - $ sign ; if ( $ b < 0 ) $ sign = - $ sign ; while ( $ b != 0 ) { $ m = $ a % $ b ; $ a = $ b ; $ b = $ m ; } return $ sign * abs ( $ a ) ; }
Compute greates common denominator, using the Euclidean algorithm

Compute and return gcd($a, $b)

@param int $a
@param int $b
@retval int
Compute greates common denominator using the Euclidean algorithm