bcsqrt

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

bcsqrt Ottiene la radice quadrata di un numero a precisione arbitraria

Descrizione

bcsqrt(string $operando, int $precisione = ?): string

Restituisce la radice quadrata di operando. Il parametro opzionale precisione imposta il numero di cifre dopo il punto decimale nel risultato.

Esempi

Example #1 esempio di bcsqrt()

<?php

echo bcsqrt(2, 3); // 1.414

?>

Vedere anche:

bcpow().

add a note add a note

User Contributed Notes 1 note

up
1
markogrady18 at gmail dot com
9 years ago
The bcsqrt function is very handy for finding the square root of numbers in the form of strings.

//EXAMPLE:
   
<?php

$arr
= array(
       
"one" => "20",
        
"two" => "12"
   
);

echo
bcsqrt($arr["one"], 3);

//OUTPUT: 4.472
To Top