Top "Mod" questions

For questions related with the *mod operation*, that can arise in Cryptography, Number Theory, Hashing, etc.

Mod in Java produces negative numbers

When I calculate int i = -1 % 2 I get -1 in Java. In Python, I get 1 as the result of -1 % 2. …

java math mod
SQL: What does "DISTINCT ON (expression)" do?

I understand how DISTINCT works, but I don't understand DISTINCT ON (expression). Take the first example from this screenshot: How …

sql database postgresql mod distinct-on