How to find remainder without division or modulo operator in MIPS assembly
问题 I want to find a way to know if an integer is divided by 3 or 7 without using division, because it is very slow in MIPS assembly. I have done a lot of research but found nothing. 回答1: There's a method described by Granlund & Montgomery that requires the modular / multiplicative inverse of the (odd) divisor modulo 2**b . (Some parts of this paper have been improved recently) The divisors: (d) = 3, 7 (odd numbers) are an easy case. Assuming 32 bit (unsigned) arithmetic, the inverses modulo 2*