2 ms·
EDIT: This is actually wrong, because it doesn't correctly describe how negative arguments are handled. It can be phrased mathematically like this: Consider t
by im3w1l 6y ago
EDIT: This is actually wrong, because it doesn't correctly describe how negative arguments are handled.
It can be phrased mathematically like this:
Consider the equivalence relation a ≡ b (mod n). It has n equivalence classes. Use 1..n as the canonical elements for the classes.
mod1 takes a number, finds its equivalence class and returns the canonical element.