<?php
array gmp_rootrem ( GMP|int|string $num, int $nth )
where,
$num = The GMP numeric value
$nth = The root to consider as an INTEGER value
?>
<?php
function intptroottrem01 ( $a01, $r01)
{
$rr01 = gmp_rootrem($a01, $r01);
echo 'The root ' . $r01 . ' of ' . $a01 . ' is ' . $rr01[0];
echo ' ( INTEGER PORTION )<br>and ' . $rr01[1] . ' is the remainder.<br><br>';
}
$a01a = [ '0200000', '0200001',
'0x10000', '0x1000A',
65536, 65537, 200,
'023', '0x13',
0, 1, 2, 4, 19 ];
$nt01 = mt_rand(1, 3);
foreach($a01a as $a01)
{
intptroottrem01($a01, $nt01);
}
?>
<?php
function intptroottrem02 ( $a02, $r02)
{
$rr02 = gmp_rootrem($a02, $r02);
echo 'The root ' . $r02 . ' of ' . $a02 . ' is ' . $rr02[0];
echo ' ( INTEGER PORTION )<br>and ' . $rr02[1] . ' is the remainder.<br><br>';
}
$a02a = [ '0200000', '0200002',
'0x10000', '0x1000A',
65536, 65537, 200,
'023', '0x13',
0, 1, 2, 4, 19 ];
$nt02 = 0;
// Attention to this value
foreach($a02a as $a02)
{
intptroottrem02($a02, $nt02);
}
?>