Re:GodBolt: Enter C, get Assembly
by foldr on Thursday December 15, 2016 @11:38AM
(#13185833)
>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.
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.