3

I was having this long discussion with a colleague as to whether the Modulo operation is a standard mathematical operation or not.

He insisted the programming languages don't have a defined standard for the sign of the operation because it's not mathematical standard which dictates Euclidean division and therefore they were free to decide. Upon showing the point mentioned in Wikipedia which stated:

In mathematics the result of the modulo operation is the remainder of the Euclidean division.

he said it's just a Wikipedia article not a standard and that the immediately following statement:

However, other conventions are possible.

actually point to the fact that the operation is not a standard meaning Euclidean division.

Is the modulo operation a standard mathematical operation?

As a side question, how are standards defined in mathematics?

  • 1
    In maths, mod isn't used as an operator. It's an equivalence relation. So $7\equiv 3$ (mod $4$) and $7\equiv -1$ (mod $4$) or even $7\equiv 15$ (mod $4$) are all correct (and equivalent) statements. – Alex Feb 01 '14 at 10:08
  • ... and we don't actually use division in the process. Thus a statement like $a\equiv b\pmod 0$ has a perfectly defined meaning (namely that $a=b$), whereas your average CPU will shout division by zero when you try to compute a % 0. – Hagen von Eitzen Feb 01 '14 at 11:25

0 Answers0