News for hackers. Stuff that matters.
Re:Babylonian Multiplication in the shower (2016) by RajuVarghese on Saturday August 29, 2020 @01:45AM (#24313915)
I spent some time looking at the geometric 'proof' in the photo. Was still wondering why this method would have any advantage over our conventional way of multiplying numbers because squaring would need multiplication too. Then I realized that with a table of squares one could do the calculation quite easily. To calculate the product of any 2 numbers from 1 to 100 one would need the squares of the numbers from 1 to 200. Armed with this one can calculate the product of any two numbers from 1 to 100 (there are 10'000 such combinations) with the formula. Sweet!
Re:Babylonian Multiplication in the shower (2016) by thomasahle on Saturday August 29, 2020 @06:46AM (#24315203)
It is also useful for other things. For example it shows that the product of two normally distributed random variables has the same distribution as the difference between two independent chi square variables.
Re:Babylonian Multiplication in the shower (2016) by djmips on Saturday August 29, 2020 @06:04PM (#24319746)
Yeah, the algorithm is only thousands of years old but it's very useful on the 6502. See 'Fast Signed Multiply' at http://www.ffd2.com/fridge/chacking/c=hacking9.txt for an implementation in C64 3D routines.

Also note that this algorithm was used in analog electronics to multiply. https://patents.google.com/patent/US2906459A/en

Re:Babylonian Multiplication in the shower (2016) by slongfield on Saturday August 29, 2020 @02:27AM (#24314097)
And by the sum-of-odd-numbers theorem (sum of 2n-1 = n^2), you don't even need to multiply to generate that table.
Re:Babylonian Multiplication in the shower (2016) by RajuVarghese on Saturday August 29, 2020 @05:45AM (#24314948)
True, that does remove the necessity of the table. However, I was checking how the Babylonians did it and the article that I read seems to indicate that they used base-60 tables. On a different note, does anyone know if this method has been exploited on CPUs without multiplication circuitry in the ALU?
Re:Babylonian Multiplication in the shower (2016) by ogogmad on Saturday August 29, 2020 @05:47AM (#24314961)
According to Wikipedia ([1]), Charles Putney implemented the quarter-square method for the 6502.

[1] - https://en.wikipedia.org/wiki/Multiplication_algorithm#Quart...

Re:Babylonian Multiplication in the shower (2016) by RajuVarghese on Saturday August 29, 2020 @08:11AM (#24315551)
Thanks for that pointer! Fascinating to see the multiplication method invented by the Babylonians being used on a microprocessor.
Re:Babylonian Multiplication in the shower (2016) by 082349872349872 on Saturday August 29, 2020 @02:37AM (#24314144)