which is faster, multiplication or division using shift operators in C ?

1 Like

It completely depends on target device, language, purpose, etc.

some machines multiplication can need upto 16 to 32 machine cycle. So Yes, depending on the machine type, bitshift operators are faster than multiplication / division.

However certain machine do have their math processor, which contains special instructions for multiplication/division.

–hey Pax, don’t spend a lot of time worrying about this. If you mean to shift, shift. If you mean to multiply, multiply.