array ( 0 => 'index.php', 1 => 'PHP Manual', ), 'head' => array ( 0 => 'UTF-8', 1 => 'zh', ), 'this' => array ( 0 => 'function.gmp-sqrt.php', 1 => 'gmp_sqrt', ), 'up' => array ( 0 => 'ref.gmp.php', 1 => 'GMP 函数', ), 'prev' => array ( 0 => 'function.gmp-sign.php', 1 => 'gmp_sign', ), 'next' => array ( 0 => 'function.gmp-sqrtrem.php', 1 => 'gmp_sqrtrem', ), 'alternatives' => array ( ), 'source' => array ( 'lang' => 'en', 'path' => 'reference/gmp/functions/gmp-sqrt.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_sqrt — Calculate square root
The integer portion of the square root, as a GMP number.
示例 #1 gmp_sqrt() example
<?php
$sqrt1 = gmp_sqrt("9");
$sqrt2 = gmp_sqrt("7");
$sqrt3 = gmp_sqrt("1524157875019052100");
echo gmp_strval($sqrt1) . "\n";
echo gmp_strval($sqrt2) . "\n";
echo gmp_strval($sqrt3) . "\n";
?>
以上示例会输出:
3 2 1234567890