2 ms·
>then associativity of integer multiplication, then some (probably builtin) rule that `n%n` is always 0. Is this quite right? It's not true in general that (a
by foldr 10y ago
>then associativity of integer multiplication, then some (probably builtin) rule that `n%n` is always 0.
Is this quite right? It's not true in general that (a * b) % c = a * (b % c). E.g. it's not true for 2,3,4. The relevant generalization is that (a * b) % b = 0, which has nothing to do with associativity.
- widdma 10y agoMaybe they meant distributes? Modulo (sort of) distributes over multiplication: (a * b) % c = ((a % c) * (b % c)) % c