Answering this post from The Daily WTF about Russian multiplication, here is my code:
-
function russian(a,b) {
-
return (a>1)? b*(a&1) + russian(a>>1, b<<1) : b;
-
}
-
russian(18,23);
Nice one liner :)
having fun with code
Answering this post from The Daily WTF about Russian multiplication, here is my code:
Nice one liner :)
Additional comments powered by BackType