Here I read that "The Babylonians came up with the "quarter-square multiplication", which reduces multiplication to subtraction:
a*b = (a+b)^2/4 - (a-b)^2/4
When I tried this in APL I ended up with this:
(((a + b) * 2) ÷ 4) - (((a - b) * 2) ÷ 4)
But isn't this ugly with all these parens? I Could't figure out how to put "÷ 4
" before "(a + b) * 2)
" so that it is executed last according to "right to left" rule.