Greatest common divisor: Difference between revisions
Undo revision 202937 by Grondilu (talk) not really better on second thought
(→Recursive: use the UInt type and the constraint in a proto) |
|||
Line 2,322:
===Recursive===
<lang perl6>
multi gcd (Int $a, 0) { abs $a }
multi gcd (Int $a, Int $b) { gcd $b, $a % $b }</lang>
===Concise===
|