Ethiopian multiplication: Difference between revisions
Content added Content deleted
Johnicholas (talk | contribs) |
|||
Line 897: | Line 897: | ||
=={{header|Ela}}== |
=={{header|Ela}}== |
||
Translation of Haskell: |
Translation of Haskell: |
||
<lang ela>open |
<lang ela>open list |
||
halve = (/2) |
|||
double = (*2) |
|||
odd = (==1) << (%2) |
|||
ethiopicmult a b = sum <| map snd <| filter (odd << fst) <| zip |
|||
(takeWhile (>=1) <| iterate halve a) |
|||
(iterate double b) |
|||
ethiopicmult 17 34</lang> |
ethiopicmult 17 34</lang> |