-
Notifications
You must be signed in to change notification settings - Fork 5.7k
Modulo operator should work like other calculators out there #111
Description
The modulo operator on this calculator gives the result that is different to the most used calculators.
This problem appears when you start using negative numbers.
For example in the Bing and Google calculator, Maxima, Wolfram Alpha and Microsoft Excel the modulo operator gives the next results:
-25 mod 4 = 3
-25 mod -4 = -1
25 mod -4 = -3
on the Windows calculator the results came in like this:
-25 mod 4 = -1
-25 mod -4 = -1
25 mod -4 = 1
As you can see the calculation is performed different. Is it wrong? Well, that's is difficult to answer. But given this article in the Wikipedia, a lot of the programming languages take que second approach, meanwhile the math applications use the first approach.
Given that the calculator is mainly used to do math and not programming (although it has a programmer mode) I suggest that this change is needed and make it behave like a calculator.
I also sent in the past some feedback to the feedback-hub, but I did not put a lot of information.
Expected behavior
We should align scientific and programmatic applications of mod in their respective modes.
Note: A team member edited this comment for clarity on expected behavior