bcsqrt
(PHP 4, PHP 5, PHP 7, PHP 8)
bcsqrt — 任意精度数字的二次方根
说明
bcsqrt(string
$num
, ?int $scale
= null
): string
返回 num
的二次方根。
返回值
以 string 类型返回二次方根的结果,如果 num
是负数则返回 null
。
更新日志
版本 | 说明 |
---|---|
8.0.0 |
现在 scale 可以为 null。
|
范例
示例 #1 bcsqrt() 示例
<?php
echo bcsqrt('2', 3); // 1.414
?>

User Contributed Notes
There are no user contributed notes for this page.