How do computers find modulus?

前端 未结 6 1714
时光说笑
时光说笑 2021-01-04 14:15

Is there some cool algorithm with bit wise operations?

6条回答
  •  攒了一身酷
    2021-01-04 15:00

    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.

提交回复
热议问题