# Negative modulo question

1. Jul 14, 2012

### Arixal

Can someone please explain why 80 mod (-11) is -8…? Why isn’t it 3?

b = aq + r
80 = (-11)q + r
80 = (-11)(-7) + 3
Thus 80 mod (-11) = 3..

2. Jul 14, 2012

### SteveL27

-8 and 3 are equivalent mod -11. Both answers are right.

3. Jul 15, 2012

### haruspex

Yes, they are the same, but typically a mathematical function with multiple 'valid' values is assigned a standard value by convention. Thus, the √ function is defined to be the non-negative root; arcsin etc. also have standard ranges.
In number theory, the non-negative value is taken for the mod function regardless of the signs of the arguments. Programming languages are annoyingly inconsistent. See http://en.wikipedia.org/wiki/Modulo_operation#Remainder_calculation_for_the_modulo_operation.

4. Jul 15, 2012

### HallsofIvy

Staff Emeritus
There are a number of different ways of thinking about "modulo". The most fundamental uses "equivalence" classes. -8 and 3 are in the same equivalence class "modulo 11" because -8= (-1)11+ 3 or, alternatively, 3+ 8= 11= 0 (mod 11) so that 3 is the additive inverse of 8: -8= 3 (mod 11).

It is a common convention to use the smallest positive number in an equivalence class to "represent" the class but any number in the class can be used. Sometimes it is convenient to use "-8" rather than "3" just as sometimes it is convenient to use 2/4 rather than 1/2.