"KCalc" supports Chris. But "Galculator" does not, goes along with QB64(PE).
In other words, "KCalc", an accessory for KDE Plasma D.E. (I tested on NeptuneOS) always returns a positive result from negative dividend and positive divisor. With this program from -27 MOD 5 the answer is 3.
However, "Galculator" which I reckon was created by GNOME but running and posting this from EndeavourOS/Falkon, the results are negative. I try with -27 MOD 5 and get -2.
FROM:
https://en.wikipedia.org/wiki/Modulo_operation
I think is what Chris is trying to say is he would rather write "-1 pmod 5" instead of "pmod(-1, 5)", assuming the "pmod()" is the user's function to make sure modulo is positive. Or even better, write "-1 MOD 5" instead of "-1 PMOD 5". To him, "MOD" is as sacred as plus, minus and whatever else is an operator and therefore it shouldn't be written as function call. Sadly, to be able to do that, QB64(PE) would have to support OOP and the programmer would have to override "MOD" operator, like actually has to be done in C++.
In other words, "KCalc", an accessory for KDE Plasma D.E. (I tested on NeptuneOS) always returns a positive result from negative dividend and positive divisor. With this program from -27 MOD 5 the answer is 3.
However, "Galculator" which I reckon was created by GNOME but running and posting this from EndeavourOS/Falkon, the results are negative. I try with -27 MOD 5 and get -2.
FROM:
https://en.wikipedia.org/wiki/Modulo_operation
Quote:When exactly one of a or n is negative, the naive definition breaks down, and programming languages differ in how these values are defined.
I think is what Chris is trying to say is he would rather write "-1 pmod 5" instead of "pmod(-1, 5)", assuming the "pmod()" is the user's function to make sure modulo is positive. Or even better, write "-1 MOD 5" instead of "-1 PMOD 5". To him, "MOD" is as sacred as plus, minus and whatever else is an operator and therefore it shouldn't be written as function call. Sadly, to be able to do that, QB64(PE) would have to support OOP and the programmer would have to override "MOD" operator, like actually has to be done in C++.