sqrt

(PHP 4, PHP 5)

sqrt — Square root

Описание

float sqrt ( float $arg )

Returns the square root of arg .

Список параметров

arg

The argument to process

Возвращаемые значения

The square root of arg or the special value NAN for negative numbers.

Примеры

Пример #1 sqrt() example

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

Смотрите также

Коментарии

if you want a custom square root. Use pow() or powLogExp function (custom). 

example:
100 root 3. In math is same as 1 divide with 3 (important)
<?php
$root 
1/3
echo 
pow(1000$root);
echo 
powLogExp(1000$root);

function 
powLogExp($num1$num2){
   
$num3 log($num1) * $num2;
    return 
exp($num3);
}
?>
With this, you might using more complex 'root'
reference: counting math using log
2025-01-18 07:10:25
http://php5.kiev.ua/manual/ru/function.sqrt.html

    Поддержать сайт на родительском проекте КГБ