Remainder without using modulus.

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
thank you so much.
closed account (D80DSL3A)
Another method would be:
a%b = a - (a/b)*b
Topic archived. No new replies allowed.