Question

Could someone please explain why is addition operation faster than multiplication operation ?

for example if we need to multiply 25 by 50

will the compiler transform it to a for loop of additions ?

Was it helpful?

Solution

Multiplication is a much more complex process, requiring more silicon either as a multiplier circuit or in a lookup table in order to reach the same level of performance as provided by addition.

OTHER TIPS

will the compiler transform it to a for loop of additions ?

No if the processor already has a multiply instruction, which most processors anyway have.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top