public function gcd(string $a, string $b) : string
    {
        if ($a === '0') {
            return $this->abs($b);
        }

        if ($b === '0') {
            return $this->abs($a);
        }

        return $this->gcd($b, $this->divR($a, $b));
    }
public function gcd(string $a, string $b) : string
    {
        if ($a === '0') {
            return $this->abs($b);
        }

        if ($b === '0') {
            return $this->abs($a);
        }

        return $this->gcd($b, $this->divR($a, $b));
    }
public function gcd ( string $ a , string $ b ) : string { if ( $ a === '0' ) { return $ this -> abs ( $ b ) ; } if ( $ b === '0' ) { return $ this -> abs ( $ a ) ; } return $ this -> gcd ( $ b , $ this -> divR ( $ a , $ b ) ) ; }
Returns the greatest common divisor of the two numbers.

This method can be overridden by the concrete implementation if the underlying library
has built-in support for GCD calculations.

@param string $a The first number.
@param string $b The second number.

@return string The GCD, always positive, or zero if both arguments are zero.
Returns the greatest common divisor of the two numbers .