문제

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?

도움이 되었습니까?

해결책

Because

3 / 11 == 0
3 % 11 == 3
0 * 11 + 3 == 3

다른 팁

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

      0
    -------
11  | 3
    | 0
    |
    -------
      3 = Answer
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top