Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

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.



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: