How do computers find modulus?

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

Is there some cool algorithm with bit wise operations?

6条回答
  •  误落风尘
    2021-01-04 14:48

    Most of the time, modulus is just computed by dividing the two numbers. The quotient is stored in one register, and the remainder is stored in the other register. You would go after the remainder.

提交回复
热议问题