Archive for February, 2005

More calculators…

Tuesday, February 1st, 2005

In my last post, I ranted about the behaviour of the Gnome calculator. But as Robert Watkins pointed out - not all calculators are equal. In fact their behaviour is all over the place. Here is my survey of OS systems within my reach:

Calculator Basic Mode Scientific
MacOsX CORRECT CORRECT
Windows WRONG CORRECT
Gnome (Fedora Core 3) WRONG WRONG
Gnome (more recent) CORRECT according to the website CORRECT according to the website
KDE CORRECT CORRECT

CORRECT = Obeys the laws of Mathematics. Ie 2 * 2 + 2 * 2 = 8

INCORRECT = Defies the laws of Mathematics. Ie 2 * 2 + 2 * 2 = 12

So next I have to dig out some mechanical and handheld calculators and try it on them. So far it seems that TI ’scientific’ calculators have been correct at least since the 1970s which makes sense and explains why I had the understanding that all calculators work that way - that is the sort of calculator I used in high school, and I would hope that is the kind used today - not TI necessarily, but something that is correct.

The Nokia phone that I use is wrong - but then I have never used it to do calculations.

Googling for recommendations about calculators for students, it seems that at least the Irish education authorities recommend: “If the calculator executes operations in the order in which they were keyed in, the answer displayed will be 14 - which is incorrect. If the calculator follows the conventional order of precedence for arithmetic operations, it will display the correct answer, 11. The first type of calculator is referred to as an arithmetic logic calculator. Many four-function and desktop business-style calculators are of this type. Virtually all scientific calculators, on the other hand, are of the second type. These are called algebraic logic calculators, and they apply the conventional rules of precedence to any sequence of arithmetic operations. Scientific calculators with algebraic logic are recommended for post primary students.”

I guess this is a lesson that the kind of usability that is basically lacking in the real world, the kind of problem that we often don’t notice until one day it bites us like it did me today. And how easy it is to overlook these problems

For an example of how easy it is to overlook basic usability like this, did you ever notice that calculators and keyboards have their keys in the opposite order to phones? Why is that? And why does an ATM match a phone not a calculator? What if you had to enter your PIN on a computer’s numeric keypad? Would you get it right?

Gnome calculator is broken (on Fedora)

Tuesday, February 1st, 2005

So I’m doing some work to double check the arithmetic of our app, and I’m using the gnome calculator. And I notice a bug - what do you think it gives if you type in: 2 * 2 + 2 * 2? So assuming we’ve all done basic primary school maths, the answer is 8 right?

Wrong

According to gnome calculator, its 12!

And not only is it wrong, they have known about it since at least the middle of 2004 and it still has not been fixed. And even then it appears that the broken behaviour is “still an alternate mode with this latest version”. Even if that version exists, it is not a part of Fedora core 3.

So here’s a nice friendly note to the gnome developers: YOU DON’T GET A VOTE ON THE LAWS OF MATHEMATICS. FIX IT. IT IS WRONG.”’

And just to reinfrce it, it does indeed work on the KDE calculator, windows, MacOsX….

Update OK, so it appears that the latest version fixes this problem (2004-11-03). So my question is replaced with “Why did it take them so long” and “Why hasn’t Fedora fixed this yet?”. I have left the main text intact, because it conveys some of the disbelief and frustration at the implementation, and they deserve it for leaving it there so long - and definitely for keeping it as an “alternate mode”. Hi guys - I’ll say it again: There is no alternate mode.

I guess the lesson to take from this is that there are some places where we, as developers, just don’t get a choice. It doesn’t matter if we don’t understand the laws of precedence, they are fixed, and have been in place for at least 400 years. In this case the mathematicians are right. Literally “by definition”.

Update: See also More on Calculators…