Pressing "add" right before "multiply" changes the Windows Calculator results

I should have figured out a calculator by now. I haven't, it turns out. If you have a Windows machine around you, go ahead and try this:

  1. Open the Windows Calculator.
  2. Set it to "Scientific".
  3. Punch in 2 + 2 × 2, you get 6.
  4. Press CE
  5. Try again, this time after 2 + 2 punch in another + and then × 2, you get 8.

The results change! One time it is 6 and another time 8!

I discoverd this when I was tracing back my steps, fixing a calculation mistake. In my many, many years of tinkering with computers, I have used the Windows Calculator pretty often. So you can imagine how horrified I was discovering this "capability".

Windows Calculator showing a different result when "add" is pressed before "multiply"
Windows Calculator showing a different result when "add" is pressed before "multiply"

This is just one example, and one that I may be able to explain. In a typical calculator, + is doing the job of =. You will notice that when you punch in the second +, parentheses appear around your 2 + 2. Windows Calculator is telling you that it realizes you wanted to evaluate the equation so far. Everything after that applies to the equation's results.

But it shouldn't be that way. People make mistakes. You may, by accident, punch in a + and want to change it to ×. In fact, this correction is totally ok in the "Standard" mode of the Windows Calculator.

The behaviour is fine in the "Standard" mode. You get 6
The behaviour is fine in the "Standard" mode. You get 6

Needless to say I was oblivious to this behaviour of the "Scientific" mode. That is, until it made me make a mistake important enough that I had to find the root cause. A root cause that also went back to my roots.

You see, in my early 10s, I used to hang out at my uncles' supermarket. It was very common at that time for the cashier to heavily rely on a calculator. Barcode scanners and cash registers were for the bigger retailers. That supermarket was a small operation so they would sum up the prices manually.

To me they were insanely fast usually having memorized the prices and having excellent muscle memory for using the calculator. One of the muscle memory shortcuts was that they would press + after every item price (most often a couple of times while their other hand was picking up the next item).

This was because the + button was this magical do-it-all for them. Using + was showing the results just like = with the added benefit that pressing + multiple times didn't do anything. Pressing the = button on the other hand would repeat the last operation. This was risky. As I mentioned, the calculator was pretty well used at the time and they were using it pretty fast, so there was always a chance that the button did not register the operation the first time. It was much easier to mash + a couple of times without looking, as opposed to having to check if the = has worked the first time, every time. Worse yet, the = could have registered twice, inflating the sum.

The family supermarket that was also my calculator bootcamp
The family supermarket that was also my calculator bootcamp

Long story short, pressing + required much less attention than = because if you were unsure that you pressed it, you could just try again.

My uncles eventually ended that supermarket lease but I kept seeing the + mashing behaviour everywhere. Often, I noticed the print of the + button was wearing out faster than the other keys.

Using the plus button instead of equal
Using the plus button instead of equal

In my school years, I didn't use calculators frequently. The Iranian educational system had no appetite for kids using calculators neither in the class nor for the exams. Still, by high school a lot of my classmates had graphing calculators. I gather this has been the inspiration for the Windows Calculator's "Scientific" mode. I don't know why we had these calculators back then. We weren't using them in the classroom. Heck, we didn't even know what their uses were.

My guess is that we had them because it was a widely available and affordable "science" device that one could gift a student our age. Most of us were given one without any clear use for it. Our rebellious teenager minds didn't figure out how to toy with it (let alone running DOOM) so it was just a vanity that we carried in and out of the school every day.

When I entered the university, it was fine to use a calculator at that level; however, by that time phones were pretty common. All had calculators in them. The only time I needed an actual calculator was during exams, because phones were prohibited. I remember I once borrowed my dad's graphing calculator to take for an exam. I was thinking it would somehow give me better numbers than the 8-digit Casio pocket calculator I had. It ended up being pretty tedious to use and I didn't know many of the basic things like erasing a digit. Still, it looked cool.

Using this scientific calculator was the first time I understood the phrase "syntax error". This was new to me and one of the reasons I was slower with this kind of calculator. With my pocket calculator, pressing any button would make something happen – not the case for the graphing calculator. Needless to say, I never had a reason to use a graphing calculator until I faced this issue. Thinking that there must be some explanation stemming from the old graphing calculators, I tried a few emulators. In all cases, I either got the aforementioned 6 or the syntax error.

Syntax error by a scientific calculator
Syntax error by a scientific calculator

For the above reasons, calculators have always served me inside computers to the level that a keyboard qualifier for me is having a conveniently-placed calculator button. I also follow the footsteps of the + mashers who came before me because it is fun and practical. I press + almost without thinking about what I want to do next. The standard keyboard numpad doesn't even have an = button so I can't be alone in this. That's why the behaviour change of × right after + came out of nowhere for me.

It soon got stranger. If you punch in 2 + 2, then × and then + 2, you will get 2 + (2 + 2). The result doesn't change compared to the "Standard" mode, but I don't understand why the second part gets wrapped in parentheses. Curiously, the Calculator does not exhibit this behaviour when the first operation is ×, in which case there would have been a difference in the results of 2 × 2 + 2 versus 2 × (2 + 2).

Windows Calculator adding curious parentheses
Windows Calculator adding curious parentheses

This blog post went a lot deeper than I initially expected. It's almost a philosophical discussion to determine whether this is a bug or user error. I gather, the people at Microsoft came up with this behaviour to avoid throwing a syntax error. Safe to say though, they haven't been to my uncles' supermarket.