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