[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: kcalc math bug?



begin  Adam Majer  quotation:

> _Any_ calculator that isn't a piece of crap will follow the standard
> precedence rules. Those rules _must_ be obeyed otherwise the real
> numbers that everyone loves so much would not even form a field [this
> will probably not mean anything to you but...]
> 
> If you want 1*2+5*50 to be equal to 350 then enter is as (1*2+5)*50=7*50=350
> 
> AFAIK, a $5 calculator will follow precedence..
> 
> I hope you realize your error by now..

Well, let's see. I have two cheap calculators right here, one a nearly
20-year old Casio FX-115 scientific calculator, and the other a fairly
new Texas Instruments TI-1795SV (four-function with memory). Both are
infix, not RPN.

Casio: 1+2*3=7
TI:    1+2*3=9

I suspect that "scientific" vs. "four-function" is the distinction here.
The scientific calculator has parenthesis buttons to facilitate entering
complex expressions, while the four-function does not.

Your math-theory objection is really irrelevant to all this. For a
four-function calculator used for simple accounting tasks, you don't
want it to get too clever with the numbers you're entering, because
mostly you're working your way down a column entering numbers in a
sequence. You need a running total after each one, which would make no
sense if the calculator was waiting for you to finish so it could go
back and apply precedence rules.

Craig

Attachment: pgpH6Tg5gdqJe.pgp
Description: PGP signature


Reply to: