Ethiopian multiplication: Difference between revisions
Content added Content deleted
(→{{header|PL/M}}: Typo) |
m (→{{header|Ruby}}: Use end-less defs) |
||
Line 5,217: | Line 5,217: | ||
Iterative and recursive implementations here. |
Iterative and recursive implementations here. |
||
I've chosen to highlight the example 20*5 which I think is more illustrative. |
I've chosen to highlight the example 20*5 which I think is more illustrative. |
||
<syntaxhighlight lang="ruby">def halve(x) |
<syntaxhighlight lang="ruby">def halve(x) = x/2 |
||
def double(x) x*2 |
def double(x) = x*2 |
||
# iterative |
# iterative |