Arquivos
hhvm/hphp/test/vm/gcd.php
T
Jordan Delong 363d1bb20f Code move src/ -> hphp/
This change is mostly for FB internal organizational reasons.
Building is not effected beyond the fact that the target now
lands in hphp/hhvm/hhvm rather than src/hhvm/hhvm.
2013-02-11 02:10:41 -08:00

19 linhas
239 B
PHP

<?php
function gcd($x, $y) {
if ($x >= $y) {
$a = $x;
$b = $y;
} else {
$a = $y;
$b = $x;
}
if ($b <= 0) {
if ($b >= 0) {
return $a+0;
}
}
return gcd($b+0, $a-$b);
}
echo gcd(330, 462);
echo "\n";