Ethiopian multiplication: Difference between revisions

→‎{{header|CoffeeScript}}: added one liner option to coffeescript
(→‎{{header|CoffeeScript}}: added one liner option to coffeescript)
Line 1,938:
throw Error("broken for #{i} * #{j}") if multiply(i,j) != i * j
</syntaxhighlight>
 
=== CoffeeScript "One-liner" ===
 
ethiopian = (a, b, r=0) -> if a <= 0 then r else ethiopian a // 2, b * 2, if a % 2 then r + b else r
 
=={{header|ColdFusion}}==
2

edits