protected function gcd($a, $b)
    {
        while ($b != 0) {
            $remainder = $a % $b;
            $a = $b;
            $b = $remainder;
        }
        return abs($a);
    }
protected function gcd($a, $b)
    {
        while ($b != 0) {
            $remainder = $a % $b;
            $a = $b;
            $b = $remainder;
        }
        return abs($a);
    }
protected function gcd ( $ a , $ b ) { while ( $ b != 0 ) { $ remainder = $ a % $ b ; $ a = $ b ; $ b = $ remainder ; } return abs ( $ a ) ; }
Calculate the greatest common divisor

@param $a
@param $b
@return int
Calculate the greatest common divisor