Christ Stevenson bitched about the Gnome calculator Apparently, if you enter the equation ‘2*2+2*2’, it gives an answer of 12.
Written down, as above, operator precedence comes into play. Humans (and equation-solving programs) are meant to understand operator precedence, and know that the equation listed comes to 8. But a calculator is not an equation solver.
Most electronic calculators are modelled after the older mechanical calculators. These devices didn’t solve equations: they performed simple arithmetic, on two values at a time. As such, it would evaluate the above equation in the order of entry, at each step working out the new base value: 2 * 2 = 4, + 2 = 6, * 2 = 12. The mechanical nature of these devices meant that no other solution was possible. People who had to use mechanical calculators simply made sure that they re-arranged the equation as required, possibly factoring it a few times as they worked out sub-equations. ‘2*2 = 4. Okay, that’s the first half. Write that down. Second half: 2*2 = 4. Ok. Now, 4 + 4 = 8!”. The mechanical calculator took away the arithmetic, not the work involved in understanding the equation.
Electronic calculators followed the user interface paradigm set by the the mechanical version. And, of course, calculator programs followed suit.
To put it bluntly, a calculator is not an equation solver. It doesn’t accept an entire equation in a single pass, waiting for you to hit an ‘evaluate’ button; it evaluates as you go, as you enter. For most “kitchen arithmetic” problems, this is fine. For trickier work, you use an engineering or scientific calculator, which typically can construct an entire equation in one pass. Or, in software, you use a spreadsheet or a mathematical program instead.
So, in calculator land, 2*2+2*2 really does equal 12. Not 8. If it helps, think of it as ((2*2)+2)*2… that’s what the calculator does.
Update: In accordance with that rule, the Windows XP calculator, in standard mode, will evaluate to 12, whilst in scientific mode, it will evaluate to 8.