Voting

: one minus one?
(Example: nine)

The Note You're Voting On

x-empt-php dot net at ispep dot cx
23 years ago
No need to compile gmp functions in just for the GCD function... use this one instead:

function GCD($num1, $num2) {
/* finds the greatest common factor between two numbers */
if ($num1 < $num2) {
$t = $num1;
$num1 = $num2;
$num2 = $t;
}
while ($t = ($num1 % $num2) != 0) {
$num1 = $num2;
$num2 = $t;
}
return $num2;
}

<< Back to user notes page

To Top