3 ms·
But 13 is also equivalent to -2 and 1, mod 3. Why are you doing the modulo operation in the first place? From a mathematical standpoint, I've never seen a use
by bajsejohannes 4y ago
But 13 is also equivalent to -2 and 1, mod 3. Why are you doing the modulo operation in the first place?
From a mathematical standpoint, I've never seen a use for returning -2 here. I want something unique for the group, so I can ask e.g. `x mod 3 == y mod 3` and have it work regardless of whether x or/and y are negative.
- jhncls 4y agoYour safest bet would be `(x - y) mod 3 == 0`. Of course, that doesn't solve the case when you want to bin the values.