Hacker News new | ask | show | jobs
by zaarn 2479 days ago
Easy.

-3 x -2, multiply signs first: +, remainder: 3x2 repeat 2 3 times and add; 2 + 2 + 2 = 3, remainder: 0

3.141 * 3.141, multiply signs first: +, remainder 3x2 repeat 3.141 3 times and add; 3.141 + 3.141 + 3.141 = 9,432, remainder: 3.141 * 0.141

shift decimal: 3.141 * 1.41, remainder: 3.141 * 1.41

3.141 * 1.41, repeat 3.141 1 times and add: 3.141 = 3.141, remainder: 3.141 * 0.41

shift onto result: 9.432 + 0.3141 = 9.7461, remainder: 3.141 * 0.41

shift decimal: 3.141 * 4.1

repeat 3.141 4 times and add; 12.564, remainder: 3.1410.1

shift onto result: 9.87174‬

shift decimal: 3.141 1

shift onto result: 10,053764‬

result: 9,875881‬

check back with calculator: 3.141 * 3.141 = 9,875881

Multiplication can be represented as a number of additions and shifting the results of substeps over the decimal point

1 comments

No one is arguing that one cannot implement multiplication algorithms using addition. In fact, one can do it with just NAND. But the definition of multiplication isn't in terms of NAND or addition.