BC Math Функции
PHP Manual

bcsqrt

(PHP 4, PHP 5)

bcsqrtGet the square root of an arbitrary precision number

Описание

string bcsqrt ( string $operand [, int $scale ] )

Return the square root of the operand .

Параметри

operand

The operand, as a string.

scale

Този незадължителен параметър се използва за да се установи броя на цифрите след десетичната точка в резултата. Също така може да установите глобалния 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

?>

Вж. също


BC Math Функции
PHP Manual