bcsqrt

Get the square root of an arbitrary precision number

&reftitle.description; `string` `bcsqrt` `string` `num` ``int``null```scale`&null;

Return the square root of `num`.

&reftitle.parameters;

`num`

- The operand, as a well-formed BCMath numeric string.

&reftitle.returnvalues;

Returns the square root as a well-formed BCMath numeric string.

&reftitle.errors;

This function throws a `ValueError` in the following cases:

- `num` is not a well-formed BCMath numeric string
- `num` is less than `0`
- `scale` is outside the valid range

&reftitle.changelog;

&Version; | &Description;
8.0.0 | If `num` is not a well-formed BCMath numeric string, or less than `0`, a `ValueError` is thrown. Previously, `E_WARNING` was raised instead.
8.0.0 | `scale` now needs to be between `0` and `2147483647`; previously, negative scales have been silently treated as `0`.
8.0.0 | `scale` is now nullable.

&reftitle.examples;

### `bcsqrt` example

    <?php

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

    ?>

&reftitle.seealso;

- `bcpow`
- `BcMath\Number::sqrt`