The modulo operation is not that trivial

Surprise In Python, -1977 % 100 = 23. In JavaScript, -1977 % 100 = -77. WTF? Explanation Modulo in different languages has different meaning! It’s not like the plus (+) operator which means the same thing in every language when applied for two integers, for instance. In Python: a % b = a - (b […]