note 28415 added to function.gmp-gcd
| From: | Ludwig at rack1 dot php dot net | Date: | Sun, 12 Jan 2003 16:33:08 +0000 |
| Subject: | note 28415 added to function.gmp-gcd | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-42023@lists.php.net to get a copy of this message | ||
The following function is more accurate:
function GCD($num1, $num2) {
/* finds the greatest common factor between two numbers */
while ($num2 != 0){
$t = $num1 % $num2;
$num1 = $num2;
$num2 = $t;
}
return $num1;
}
--
http://www.php.net/manual/en/function.gmp-gcd.php
http://master.php.net/manage/user-notes.php?action=edit+28415
http://master.php.net/manage/user-notes.php?action=delete+28415
http://master.php.net/manage/user-notes.php?action=reject+28415