Greatest common divisor: Difference between revisions
Content added Content deleted
m (→{{header|Wren}}: Changed to Wren S/H) |
m (→{{header|Raku}}: add an alternative) |
||
Line 5,510: | Line 5,510: | ||
multi gcd (Int $a, 0) { abs $a } |
multi gcd (Int $a, 0) { abs $a } |
||
multi gcd (Int $a, Int $b) { gcd $b, $a % $b }</syntaxhighlight> |
multi gcd (Int $a, Int $b) { gcd $b, $a % $b }</syntaxhighlight> |
||
===Recursive(inline coderef)=== |
|||
<syntaxhighlight lang="raku" line>{ $^b ?? &?BLOCK( $^b, $^a % $^b ) !! $^a }</syntaxhighlight> |
|||
===Concise=== |
===Concise=== |