News for hackers. Stuff that matters.
Re:Again on 0-based vs. 1-based indexing by im3w1l on Wednesday January 20, 2021 @05:19AM (#25844653)
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.

There are no comments on this comment yet.