CakeFest 2024: The Official CakePHP Conference

sqrt

(PHP 4, PHP 5, PHP 7, PHP 8)

sqrt平方根

説明

sqrt(float $num): float

num の平方根を返します。

パラメータ

num

処理する引数。

戻り値

num の平方根を返します。 負の数を指定した場合は、特別な値 NAN を返します。

例1 sqrt() の例

<?php
// 小数点以下の精度は、precision ディレクティブの設定に依存します
echo sqrt(9); // 3
echo sqrt(10); // 3.16227766 ...
?>

参考

add a note

User Contributed Notes

There are no user contributed notes for this page.
To Top