# Thread: Modulus of negative numbers

1. ## Modulus of negative numbers

Hello

I really hope someone can help me with this.

I am reading lecture notes and it says the following -

-12 mod 11 = 10
-1 mod 11 = 10

When I do -12 mod 11 and -1 mod 11 on my calculator I get -1 for both.

Is there a trick or something extra I am missing here?

Note I am dealing with finite fields.

Any help greatly appreciated.

Thanks

2. I think the answer has something to do with 22 - 10 = 11, where 22 is a multiple of 11 which is greater than 12.

Why doesn't the % (in C) and a calculator give the correct answer?

3. Hello,

Originally Posted by MrSteve
Hello

I really hope someone can help me with this.

I am reading lecture notes and it says the following -

-12 mod 11 = 10
-1 mod 11 = 10

When I do -12 mod 11 and -1 mod 11 on my calculator I get -1 for both.

Is there a trick or something extra I am missing here?

Note I am dealing with finite fields.

Any help greatly appreciated.

Thanks
If a mod n=b, this means that (a-b) is a multiple of n.

Another thing is : if a mod n=b, then a mod n is also equal to b+nk, for any k in $\displaystyle \mathbb{Z}$

Here, -12 mod 11=-12, ok

-1 mod 11=-1, ok

If a mod n=b, and b mod n=c, then a mod n is also equal to c. This can help for further things...

4. I'm sorry, you completely lost me there.

Here, -12 mod 11=-12, ok
But -12 mod 11 = -1

-1 mod 11=-1, ok
How did -1 mod 11 = -1 change to -1 mod 11 = 10??

5. Ahhh are you saying if the answer is a minus, just add the modulus to the answer and you get the correct result?

6. Originally Posted by MrSteve
Ahhh are you saying if the answer is a minus, just add the modulus to the answer and you get the correct result?
It's enough, yep.

7. OK, brilliant, thank you for your help.

8. Originally Posted by MrSteve
How did -1 mod 11 = -1 change to -1 mod 11 = 10??

Because they should nto be equal signs, they are congruent, not equal. They are in the same equivalence classes, which are represented with $\displaystyle \equiv$ This is like saying "your house is like my house because they each have garages" thus we have created an equivalence class of buildings with garages. That does not mean that your house is the same as my house, it just means they are congruent.

So $\displaystyle \-12 \equiv -1 \equiv 10 (mod 11)$

This is because
-12 = (0)11 -12
-12 = (-1)11 -1
-12 = (-2)11 +10

With mod 11, we have 11 equivlance classes: 0-10
(note that eleven is congruent to zero) and the integers in those classes may not be equal, but they will all return the same remainder when divided by eleven.

You can try it, type in -12/11, -1/11, 10/11 in your calculator, notice that they all have a remainder of .90 repeating