I l@ve RuBoard Previous Section Next Section

bcsqrt

string bcsqrt(string left_operand, [int scale]) 

left_operand

Number to calculate from

scale

Number of decimal places to return

Calculates square root.

Returns:

Square root of left operand

Description:

bcsqrt() calculates the square root of a given number and returns the result, formatted with a specified number of decimal places (optional).

Version:

Existing since version 3.0

Example:

Calculate the square root of a large number
$num1 = "9912343.21"; 
echo bcsqrt($num1, 3); 

Output: 
3148.387 
    I l@ve RuBoard Previous Section Next Section