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)
(Undo revision 202937 by Grondilu (talk) not really better on second thought)
Line 2,322:
 
===Recursive===
<lang perl6>protomulti gcd (UInt $a0, UInt $b where $a|$b > 0) {* fail }
multi gcd (Int $a, 0) { abs $a }
multi gcd (Int $a, Int $b) { gcd $b, $a % $b }</lang>
 
===Concise===
1,934

edits