Query: gmp_gcd
OS: php
Section: 3
Format: Original Unix Latex Style Formatted with HTML and a Horizontal Scroll Bar
GMP_GCD(3) 1 GMP_GCD(3) gmp_gcd - Calculate GCDSYNOPSISGMP gmp_gcd (GMP $a, GMP $b)DESCRIPTIONCalculate greatest common divisor of $a and $b. The result is always positive even if either of, or both, input operands are negative.PARAMETERSo $a -Either a GMP number resource in PHP 5.5 and earlier, a GMP object in PHP 5.6 and later, or a numeric string provided that it is possible to convert the latter to a number. o $b -Either a GMP number resource in PHP 5.5 and earlier, a GMP object in PHP 5.6 and later, or a numeric string provided that it is possible to convert the latter to a number.RETURN VALUESA positive GMP number that divides into both $a and $b.EXAMPLESExample #1 gmp_gcd(3) example <?php $gcd = gmp_gcd("12", "21"); echo gmp_strval($gcd) . " "; ?> The above example will output: 3 PHP Documentation Group GMP_GCD(3)