Almost all languages have operators. Example of these are, “+” – addition, “-” – subtraction, “*” – multiplication, “/” division. There are also more advanced operators such as “Mod”, “Exponent”, and “And”. Let us investigate the mod.

I have seen that there are much misunderstanding about mod. Some claims that it performs a modulo operation, some claims that it is the reminder. Actually it is a reminder, and not a modulo operation.

In this investigation, I chosen Visual Basic as the default language. So, let us try to use mod operation as a modulo operation.

I would like to add that there is no problem to get the same answer back, i.e., 3 -4 mod 6 is -1, and then by adding 4 and again mod, will result 3. However, that is not the modulo. To display the modulo, use the function below:

In arrays, tables, indexes, where the index should be positive, we can use the function above.