Re: How does Modulo work?

modulo gets the remainder.

It can be read as what is the remainder of 3/6? The answer is 3.

Re: How does Modulo work?

Quote:

Originally Posted by

**helloworld922**
modulo gets the remainder.

It can be read as what is the remainder of 3/6? The answer is 3.

Thank you for your reply.

Now what is the remainder of 2/18? The answer is 16 with your way of looking at it right? But the correct answer is 2.

I know it is a silly question, but I really need more theory than that single line you gave me.

Re: How does Modulo work?

Quote:

Originally Posted by

**Mr.nuub**
Now what is the remainder of 2/18? The answer is 16 with your way of looking at it right? But the correct answer is 2.

Wrong. With "his way of looking at it", the answer is 2. How many times does 18 go into 2? Zero times, with a remainder of 2. Exactly how 6 goes into 3 zero times with a remainder of 3.

Quote:

Originally Posted by

**Mr.nuub**
I know it is a silly question, but I really need more theory than that single line you gave me.

Then you should have thrown together a test program that ran some more examples, or did more division by hand. For example, when you say 3/6 is .5, how are you arriving at that answer?