编程学问
  • 文章
  • 问题
  • 读书
  • 关于
  • 登录
  • « sinh
  • srand »
  • PHP Manual
  • Math 函数
  • 平方根

sqrt

(PHP 4, PHP 5, PHP 7)

sqrt — 平方根

说明

sqrt ( float $arg ) : float

返回 arg 的平方根。

参数

arg

要处理的参数

返回值

返回 arg 的平方根,负数时返回 NAN。

范例

Example #1 sqrt() 例子

<?php
// Precision depends on your precision directive
echo sqrt(9); // 3
echo sqrt(10); // 3.16227766 ...
?>

参见

  • pow() - 指数表达式

相关文章
php math 函数 反双曲正切php math 函数 在任意进制之间转换数字php math 函数 十进制转换为十六进制php math 函数 十进制转换为八进制php math 函数 计算 e 的指数php math 函数 显示随机数最大的可能值php math 函数 十六进制转换为十进制php math 函数 对除法结果取整php math 函数 判断是否为有限值php math 函数 判断是否为无限值php math 函数 自然对数php math 函数 以 10 为底的对数php math 函数 返回 log 1 + number ,甚至当 number 的值接近零也能计算出准确结果php math 函数 找出最大值php math 函数 找出最小值php math 函数 指数表达式php math 函数 产生一个随机整数php math 函数 对浮点数进行四舍五入php math 函数 平方根php math math 函数
关注编程学问公众号
编程学问网 湘ICP备20001732号