Ethiopian multiplication: Difference between revisions

Content added Content deleted
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) x/2 end
<syntaxhighlight lang="ruby">def halve(x) = x/2
def double(x) x*2 end
def double(x) = x*2


# iterative
# iterative