That is, what can we say about chained application of the modulo operation?

E.g., are there any theorems for certain values of a,b, and c s.t. (a % b % c) == (a % bc), or something similar?

The only thing I can think of is, given $0 < a < b < c: a \% b \% c = a$.


1 Answer 1


The operation is not associative, i.e., $$a \%(b\%c) \neq (a \%b)\%c$$ Hence, you first need to specify which one you are after $a \%(b\%c)$ or $(a \%b)\%c$

  • 1
    $\begingroup$ I think it's safe to assume he means $(a \% b) \% c$ $\endgroup$
    – MT_
    Apr 24, 2014 at 2:48
  • $\begingroup$ Thanks, yes, I did but this is good info. $\endgroup$
    – Dogweather
    Apr 24, 2014 at 2:49

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .