array ( 0 => 'index.php', 1 => 'PHP Manual', ), 'head' => array ( 0 => 'UTF-8', 1 => 'tr', ), 'this' => array ( 0 => 'function.gmp-gcd.php', 1 => 'gmp_gcd', ), 'up' => array ( 0 => 'ref.gmp.php', 1 => 'GMP İşlevleri', ), 'prev' => array ( 0 => 'function.gmp-fact.php', 1 => 'gmp_fact', ), 'next' => array ( 0 => 'function.gmp-gcdext.php', 1 => 'gmp_gcdext', ), 'alternatives' => array ( ), 'source' => array ( 'lang' => 'en', 'path' => 'reference/gmp/functions/gmp-gcd.xml', ), ); $setup["toc"] = $TOC; $setup["toc_deprecated"] = $TOC_DEPRECATED; $setup["parents"] = $PARENTS; manual_setup($setup); ?>
(PHP 4 >= 4.0.4, PHP 5, PHP 7, PHP 8)
gmp_gcd — Calculate GCD
Calculate greatest common divisor of num1
and
num2
. The result is always positive even if
either of, or both, input operands are negative.
A positive GMP number that divides into both
num1
and num2
.
Örnek 1 gmp_gcd() example
<?php
$gcd = gmp_gcd("12", "21");
echo gmp_strval($gcd) . "\n";
?>
Yukarıdaki örneğin çıktısı:
3