How does a computer perform a multiplication on 2 numbers say 100 * 55.
My guess was that the computer did repeated addition to achieve multiplication. Of course this could be the case for integer numbers. However for floating point numbers there must be some other logic.
Note: This was asked in an interview.
Repeated addition would be a very inefficient way to multiply numbers, imagine multiplying 1298654825 by 85324154. Much quicker to just use long multiplication using binary.
For floating point numbers scientific notation is used.
To multiply them together multiply the mantissas and add the exponents
The computer does this using the binary equivalents