repo.or.cz
/
hiphop-php.git
/
blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
log
|
graphiclog1
|
graphiclog2
|
commit
|
commitdiff
|
tree
|
refs
|
edit
|
fork
blame
|
history
|
raw
|
HEAD
global statement removal: hphp/test [7/x]
[hiphop-php.git]
/
hphp
/
test
/
quick
/
gcd.php
blob
c15c1d5d4b70f2a3129115e46749a83445ed98f6
1
<
?hh
2
function
gcd
(
$x
,
$y
) {
3
if
(
$x
>=
$y
) {
4
$a
=
$x
;
5
$b
=
$y
;
6
}
else
{
7
$a
=
$y
;
8
$b
=
$x
;
9
}
10
if
(
$b
<=
0
) {
11
if
(
$b
>=
0
) {
12
return
$a
+
0
;
13
}
14
}
15
return
gcd
(
$b
+
0
,
$a
-
$b
);
16
}
17
echo
gcd
(
330
,
462
);
18
echo
"
\n
"
;