The Old New Thing

# When you change the insides, nobody notices

Raymond Chen

I find it ironic when people complain that Calc and Notepad haven’t changed. In fact, both programs have changed. (Notepad gained some additional menu and status bar options. Calc got a severe workover.)

I wouldn’t be surprised if these are the same people who complain, “Why does Microsoft spend all its effort on making Windows ‘look cool’? They should spend all their efforts on making technical improvements and just stop making visual improvements.”

And with Calc, that’s exactly what happened: Massive technical improvements. No visual improvement. And nobody noticed. In fact, the complaints just keep coming. “Look at Calc, same as it always was.”

The innards of Calcâ€”the arithmetic engineâ€”was completely thrown away and rewritten from scratch. The standard IEEE floating point library was replaced with an arbitrary-precision arithmetic library. This was done after people kept writing ha-ha articles about how Calc couldn’t do decimal arithmetic correctly, that for example computing 10.21 âˆ’ 10.2 resulted in 0.0100000000000016.

(These all came from people who didn’t understand how computers handle floating point. I have a future entry planned to go into floating point representations in more detail.)

Today, Calc’s internal computations are done with infinite precision for basic operations (addition, subtraction, multiplication, division) and 32 digits of precision for advanced operations (square root, transcendental operators).

Try it: 1 / 3 Ã— 10000000000 âˆ’ 3333333333 =. The result is one third exactly. Type 1/x âˆ’ 3 = and you get zero back. (Of course, if you don’t believe that, then repeat the sequence “Ã— 10000000000 âˆ’ 3333333333 =” until you’re bored and notice that the answer always comes back as 0.33333333333333333333333333333333. If it were fixed-precision, then the 3’s would eventually stop coming.)

Thirty-two positions of precision for inexact results not good enough? The Power Calculator PowerToy uses the same arithmetic engine as Calc and lets you crank the precision to an unimaginable 512 digits.

Anyway, my point is thatâ€”whether you like it or notâ€”if you don’t change the UI, nobody notices. That’s why so much effort is spent on new UI.