Ethiopian multiplication: Difference between revisions
Content added Content deleted
m (→{{header|Python}}: imap -> izip) |
(→{{header|Python}}: Cleanup, more in line with other examples) |
||
Line 2,366: | Line 2,366: | ||
return x % 2 == 0 |
return x % 2 == 0 |
||
def ethiopian( |
def ethiopian(multiplier, multiplicand): |
||
table = list((p, q) for p, q in |
|||
izip(halver(multiplier), doubler(multiplicand))) |
|||
return sum(q for p, q in table if not even(p)) |
|||
</lang> |
|||
=={{header|R}}== |
=={{header|R}}== |