bcsqrt

(PHP 4, PHP 5, PHP 7)

bcsqrtGet the square root of an arbitrary precision number

Descrierea

bcsqrt ( string $num [, int|null $scale = null ] ) : string

Return the square root of the num.

Parametri

num

The operand, as a string.

scale

Acest parametru opțional este utilizat pentru a stabili numărul cifrelor după virgulă din rezultat. Dacă este omis, valoarea implicită va fi cea stabilită global cu funcția bcscale(), sau va fi 0 dacă nu a fost stabilită cu ajutorul acestei funcții.

Valorile întoarse

Returns the square root as a string, or null if num is negative.

Istoricul schimbărilor

Versiune Descriere
8.0.0 scale is now nullable.

Exemple

Example #1 bcsqrt() example

<?php

echo bcsqrt('2'3); // 1.414

?>

A se vedea și

  • bcpow() - Raise an arbitrary precision number to another

add a note add a note

User Contributed Notes

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