-1

Why is 3 modulo 11 equal to 3? The expression in coding syntax is usually

 3 % 11

This is the remainder of dividing 3 by 11, correct? Then the result should be 11 since that would be the remainder. What am I understanding wrong?

Lucas Alanis
  • 1,208
  • 3
  • 15
  • 30
  • 3
    No. If you take `3` divided by `11`, you get a quotient of `0` and a remainder of `3`. So `3 % 11` is `3`. – lurker Feb 13 '14 at 04:04

3 Answers3

2

3 / 11 = 0 with 3 remaining. The answer to any n mod m can never be equal to or greater than m, by definition.

Red Alert
  • 3,786
  • 2
  • 17
  • 24
2

Because

3 / 11 == 0
3 % 11 == 3
0 * 11 + 3 == 3
BenMorel
  • 34,448
  • 50
  • 182
  • 322
Weibo Li
  • 3,565
  • 3
  • 24
  • 36
1
      0
    -------
11  | 3
    | 0
    |
    -------
      3 = Answer
dotNET
  • 33,414
  • 24
  • 162
  • 251