The gmp_sqrtrem() function computes the square root of a GMP number with remainder.
Syntax
gmp_sqrtrem (val)
Parameters
val: The GMP number for which we want to compute the square root.
Return
The gmp_sqrtrem() function returns an array with 1st element as the integer square root val, whereas the 2nd element is the remainder.
Example
The following is an example:
<?php list($sqrt, $sqrtrem) = gmp_sqrtrem("8"); echo gmp_strval($sqrt) . ", " . gmp_strval($sqrtrem) . "\n"; ?>
Output
The following is the output:
2, 4