Hi guys, I am trying to find remainder without using modulus. Is there any algorithm to find it.
Call the number you want to divide by 'b'. Call the number you have 'a'.
Subtract b from a. Is the new value of a less than b? If yes, that's the remainder. If not, do it again.
Last edited on
Another method would be:
a%b = a - (a/b)*b