How do computers find modulus

assemblybit-manipulationmodulo

Is there some cool algorithm with bit wise operations?

Best Answer

Often, the modulus and divide operations on a processor are the same thing. For instance, refer to http://jsimlo.sk/docs/cpu/index.php/div.html . This is the implementation of the divide instruction on Intel processors.