(PHP 4, PHP 5)
bcsqrt — Get the square root of an arbitrary precision number
$operand
[, int $scale
] )
Return the square root of the operand
.
operand
The operand, as a string.
scale
此可选参数用于设置结果中小数点后的小数位数。也可通过使用 bcscale() 来设置全局默认的小数位数,用于所有函数。
Returns the square root as a string, or NULL
if
operand
is negative.
Example #1 bcsqrt() example
<?php
echo bcsqrt('2', 3); // 1.414
?>