gmp_root
is a function in PHP that returns the integer part of the nth root.
gmp_root(GMP|int|string $num, int $Nth): GMP
The function takes in two parameters: num
and Nth
.
num
- can be a numeric string
, int
.
Nth
- The positive root to take of num
.
gmp_root
returns the integer part of the Nth
root. The value returned is type GMP
number.
<?php// gmp_init is used to create a GMP number$val1 = gmp_init("1001", 2);$num = 3;$val2 = gmp_root($val1, $num);echo gmp_strval($val2, 2);?>
10