gmp_sqrtrem

PHP 4 >= 4.0.4, PHP 5, PHP 7, PHP 8
gmp_sqrtrem - Square root with remainder
Manual
Code Examples

gmp_sqrtrem( GMP|int|string$num ): array

Calculate the square root of a number, with remainder.

Parameters

num

The number being square rooted.

A GMP object, an int or a numeric string.

Return Values

Returns array where first element is the integer square root of num and the second is the remainder (i.e., the difference between num and the first element squared).

Example of gmp_sqrtrem

Show all examples for gmp_sqrtrem

PHP Version: