Greatest common divisor: Difference between revisions
Content added Content deleted
No edit summary |
|||
Line 455: | Line 455: | ||
===Recursive=== |
===Recursive=== |
||
< |
<lang d>long gcd(long x, long y) { |
||
if (y == 0) |
if (y == 0) |
||
return x; |
return x; |
||
return gcd(y, x%y); |
return gcd(y, x%y); |
||
}</lang> |
}</lang> |
||
=={{header|Dc}}== |
=={{header|Dc}}== |