本页内容
上一节: Func_math_sinh 下一节: Func_math_srand

PHP sqrt() 函数

Category:PHP Math 数学函数参考手册

返回不同数的平方根:


示例

<?php

echo(sqrt(0) . "<br>");

echo(sqrt(1) . "<br>");

echo(sqrt(9) . "<br>");

echo(sqrt(0.64) . "<br>");

echo(sqrt(-9));

    ?>

定义和用法

sqrt() 函数返回一个数的平方根。

语法

    sqrt(number);
参数 描述
number 必需。规定一个数。

技术细节

返回值: 返回 number 的平方根,如果 number 是负数则返回 NAN。
返回类型: Float
PHP 版本: 4+

Category:PHP Math 数学函数参考手册

上一节: Func_math_sinh 下一节: Func_math_srand
此页面最后编辑于2022年8月17日 (星期三) 22:20。