Home > PHP > Function > BC Math > bcsqrt()

bcsqrt()

bcsqrt - Get the square root of an arbitrary precision number

Syntax

string bcsqrt (string $operand, int $scale)

Arguments

  • operand - The operand, as a string.
  • scale - This optional parameter is used to set the number of digits after the decimal place in the result. You can also set the global default scale for all functions by using bcscale().

Description

Return the square root of the operand.

Version

PHP 4, 5

Return value

Returns the square root as a string, or NULL if operand is negative.