Modulus operator

How is it that 3%5=3?
closed account (1v5E3TCk)
5%2=1
8%2=0
5%4=1

x%y gives you the remainder of x/y

also read that: http://en.wikipedia.org/wiki/Modular_arithmetic
Last edited on
5%2=3

A small correction: this above is equal to 1.

5%2=1 because 5 = 2 + 2 + 1
8%2=0 because 8 = 2 + 2 + 2 + 2
5%4=1 because 5 = 4 + 1
3%5=3 because 3 = 3 (no 5 is added)
Last edited on
5%2=1 because 5 = 2*2 + 1 and

3%5=3 because 3 = 5*0 + 3.
@jonlande

How is it that 3%5=3?


Consider its reverse record

3 = 5 * 0 + 3
closed account (1v5E3TCk)
Thanks catfish. Pardon me.
Topic archived. No new replies allowed.