Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!


Click here to return to the '10.4: Be aware of a Calculator widget bug' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
10.4: Be aware of a Calculator widget bug
Authored by: cranfordio on May 24, '05 10:25:00AM

This is not necessarily a bug, it is the way it is supposed to work. If you pick up any calculator and type 1 + 2 * 3 you will always get 9. In fact, in my personal opinion, I think the other way is a bug, because it assumes that I always want to multiply, or divide, before I want to add or subtract.



[ Reply to This | # ]
10.4: Be aware of a Calculator widget bug
Authored by: Han Solo on May 24, '05 10:36:50AM
No, this is clearly a bug. At one time Apple attempted to finesse it by having the standard order of operands work properly in "scientific" mode, but this incorrect left-to-right order (i.e., not recognizing the operator precedence that everyone (should have) learned in junior high, if not earlier) in "basic" mode. Other than cheap-o $5 models, any decent calculator will get the precedence correct. Why should a Dashboard widget on a $500 - $2500 computer imitate the mathematical errors of a $5 calculator knock-off? Sorry, I'm not interested in a flame war, but I cannot see the justification.

In any event, this hint is very helpful, as the lack of consistency is arguably even worse than having it incorrect. Thanks.

[ Reply to This | # ]

10.4: Be aware of a Calculator widget bug
Authored by: chabig on May 24, '05 10:52:17AM

Different calculators behave differently, even in the physical world. As you said, $5 cheap-o calculators have always worked this way. To me, that's exactly what the calculator widget is supposed to be modeling. And the calculator shows the intermediate results, so you ought not be surprised with your final answer.

Chris



[ Reply to This | # ]
10.4: Be aware of a Calculator widget bug
Authored by: cranfordio on May 24, '05 10:52:43AM

Actually, I have a fairly expensive TI graphing calculator that when I enter the proplem in that order always gives me the answer of 9. Assuming that this was a written out problem then yes the answer should be 7, but when you enter it into a calculator it will always to the math the order in which you enter it. Which would mean it does the addition first then the multiplication. Every calculator I have ever used does it this way. The calculator in Windows even does it this way. So the way I see it, if every calculator, since there were calculators, has done it a certain way, then that is the correct way.



[ Reply to This | # ]
10.4: Be aware of a Calculator widget bug
Authored by: cybergoober on May 24, '05 11:06:00AM

Right. Notice that, using the problem in the original post, when you hit the "x" the screen displays"3" from the previous 1+2 operation.

Seems to be the way it was intended to work...



[ Reply to This | # ]
10.4: Be aware of a Calculator widget bug
Authored by: Spartacus on May 24, '05 11:47:16AM

In fact, the Windows calculator behaves differently whether it's in basic or scientific mode. Basic mode ignores operation precedence and scientific mode follows it, just like real world basic and scientific calculators do.

Note that calculators that follow precedence rules usually (always?) have parentheses buttons.



[ Reply to This | # ]
10.4: Be aware of a Calculator widget bug
Authored by: diamondsw on May 24, '05 11:59:58AM

Sorry, but you're wrong. I just pulled out both my TI-35X and TI-85 (can't believe the batteries still work after ten years) and both give 7, which is the correct answer.

Mathematics is not open to debate or your personal preference. Order of operations is correct, left to right is wrong. Period.



[ Reply to This | # ]
10.4: Be aware of a Calculator widget bug
Authored by: sdewidt on May 24, '05 01:14:07PM

I don't know, but I think the problem is that two different methods of inputing the numbers are being talked about. In other words, if you input "1 + 2" and hit enter (or equals) you get "3". Then if you hit '*3' you get "9". But if you input "1 + 2 * 3" all on the same line and then hit enter you get "7", because it follows the standard order of operations. I think this is where the misunderstanding is coming from on the Ti calculators. I'm not sure about the Mac, since I don't have one in front of me right now.



[ Reply to This | # ]
10.4: Be aware of a Calculator widget bug
Authored by: melvinwalker on May 24, '05 01:20:48PM

You keep saying this, and you don't seem to realize that it's irrelevant.

Most cheap calculators work on just one operation at a time, unlike standard infix mathematic convention. They are cheap tools for simple operations. This calculator is designed to work like them.

A person doing more complex math on one of these (heaven forbid) would OF COURSE type 2 x 3 =, then + 1 =, since he understands how his tool works. If his tool doesn't work as he desires, he has the wrong tool. These calculators are designed for balancing your checkbook, not doing your math homework.

The kind of calculator this emulates can be had for next-to-nothing. We have maybe 5 of these around the house, 2 of which we can't find. They are disposable. They are nearly ubitquitous, and it wouldn't surprise me if billions are sold each year worldwide. If it's the wrong tool for you, so be it.



[ Reply to This | # ]
Order of operations
Authored by: MattHaffner on May 24, '05 02:13:03PM

"Mathematics is not open to debate or your personal preference. Order of operations is correct, left to right is wrong. Period."

I'm fairly certain that this order of operations that we commonly use is convention, not anything intrinsic to math. So, yes, it is a personal preference. One that most of us like to use in order to communicate with each other clearly :)

It's certainly heavily influenced by the abbreviated notion introduced by algebra (2 * x = 2x), but it is more likely supremely reinforced nowadays by fiat of computer programming languages. Most simply need to establish an order of precedence to know what to do with any complex expression. Anyone who has had a whit of programming learns this on day 1, pretty much. But that's not mathematical (i.e., able to be proven, etc.), per se, it's by design and convention.



[ Reply to This | # ]
Order of operations
Authored by: Baggins on May 25, '05 11:48:40AM

No, order of operations was not determined arbitrarily. It has to do with getting accurate answers. Since multiplication is repeated addition, it MUST be done before simple addition or you will get an incorrect answer and your bridge will collapse, your engine explode, etc.

The same is true with exponents, logs, differentials, etc. They are evaluated in a certain order because they HAVE to be in order to give the correct answer.



[ Reply to This | # ]
10.4: Be aware of a Calculator widget bug
Authored by: renderhead on May 24, '05 06:16:15PM
What everyone is ignoring here is that operations entered into the calculator app (both the stand-alone app and Dashboard widget versions) are not entered "left-to-right". They are entered "first-to-last", separated chronologically, not spatially. When you write out a problem on a piece of paper like this:

1 + 3 * 2

you are able to view the entire problem at once and determine the correct order of operations. On the other hand, what if I walked up to you and said "Quick, what's one plus three?" and then after you'd answered "4", I continued with "...times two?" How would you know if I meant 1 + 3 * 2 or (1 + 3) * 2? In that situation, you'd most likely assume the latter, and so does a calculator that shows only one value at a time.

The reason graphing calculators get it right isn't because they are more expensive. It's because you enter the entire formula, which is shown on the screen as you enter it, before you hit "equals".

[ Reply to This | # ]

10.4: Be aware of a Calculator widget bug
Authored by: tieneus on Aug 10, '05 04:01:24AM

All discussion aside. if this is a math rule OR even if it is a convention then in both instances 'every' calculator should follow this, wether convention or math rule. Because less educated people (or young children) might learn it wrong or actually think that 1+2x3=9. Imagine tax-institutions using this kind of calculus to get your tax cut (would you rather pay $7.- or $9.-) :-))



[ Reply to This | # ]
10.4: Be aware of a Calculator widget bug
Authored by: Gerk on May 24, '05 11:32:02AM

I agree with you here, it's a bug.

If you WANT incremental calculations you should type:

1 + 2 = 3
* 3 = 9

1 + 2 * 3 == 7 and it always should, the calculator shouldn't assume an = anywhere in that equation unless you specifically tell it so.

Either that or they should give the option of being fully incremental (as first example) and also the option to be algebraically correct (as in second example)... sadly I don't think most people would get it and they would still complain that it's broken LOL.



[ Reply to This | # ]
10.4: Be aware of a Calculator widget bug
Authored by: diamondsw on May 24, '05 11:57:32AM

No, this is a bug. Mathematical order of operations does not change because some insanely poorly done calculator doesn't support it, or because you don't like it. Math such as this is not open to debate or preference - it is wrong, and should be fixed.



[ Reply to This | # ]
10.4: Be aware of a Calculator widget bug
Authored by: pwagenet on May 24, '05 12:46:40PM

This is not a bug. As has been said before it behaves like all $5 calculators that calculate numbers as they are given. Cheap calculators do not remember long equation strings they only deal with opertations between two numbers at a time. When you enter this equation into a cheap calculator, it can only deal with numbers in the order that they are given so 1 + 2 = 3 then 3 x 3 = 9. This is fairly obvious and has always been the way cheap calculators work. If you want a more advanced calculator then you pay for it. Here you can just use the actual app. That said, this behavior is very easily noticed, there's no way that Apple could have accidentally missed this behavior if it was not intended.

---
-Peter



[ Reply to This | # ]
10.4: Be aware of a Calculator widget bug
Authored by: DocMan on May 24, '05 01:47:02PM

Actually with a cheap $5 calculator, you cannot enter a complex calculation and have it evaluate the entire calculation at once. Such calculators are only capable of evaluating two operands with a single operator. So it's not possible to enter 1 + 2 * 3.

Any calculator where is is possible to enter multiple operators and construct complex calculations MUST evaluate the calculation according to the established rules of mathematical heirarchy.

That said, I haven't played with the widget calculator, so I don't know which class of calculator it falls into.

Doc



[ Reply to This | # ]
10.4: Be aware of a Calculator widget bug
Authored by: sbieniek on May 24, '05 02:12:25PM

I believe it works like the old skool CPA calculators (The ones with the little receipt rolls), you have all seen them.

Anyone who has had an advanced math course will be driven batty by them, the way they make you enter complex calcuations. Basically, any time you enter a calculation, 5+5 and then hit the "*" key, it acts as an "=" key before performing your calculation. So the calculator does the math, (in this case =10, and awaits your input for the multiplication)

In this instance...the calculator is assuming you are smart enough to recognize the order of operations, and are giving the input accordingly. If you want your calculator to do more than that, then pick up a more advanced version. I believe someone has already said this widget was designed to balance your checkbook. It is truly a sad day that people need a calculator for that, but that is for another debate. I would imagine a calculator that interprets your input for you would take up far more valuable RAM than many are willing to give it...but then again, you probably need the calculator to figure out just how much RAM it would actually need. :)



[ Reply to This | # ]
To those who still think 1+2x3=9
Authored by: jlaro on Sep 27, '05 03:50:37PM

Those who think 1+2x3=9 probably hated math in school because they thought it was a purely abstract subject. Well, maths ARE the real world.

If I say: 1$ + 2 x 3$, now what? Would you pay 7$ or 9$ for those three items? 1$ + 3$ + 3$, right? "No, no" you say, "it's 1$ + 2$ x 3". Ah, you mean 1$ + 2$ + 2$ + 2$ ? How much change did you get on your 10$ bill exactly? "Ah shoot" you correct again, "I bought a one-dollar item and a two-dollar item, three times". OK I get it, like (1$ + 2$) x 3, or 3 x (1$ + 2$) or 3 x 1$ + 3 x 2$ ? (this is called distributivity) Now yes, you spent 9$, but you end up with three one-dollar items and three two-dollar items. (1 + 2) x 3 is not at all the same than 1 + 2 x 3.

Got it? Class dismissed.

Next workshop: Discovery of a basic calculator's mysterious M keys. Cost: 100 + 2 x 10 + 5. Use your preferred device to calculate and make the check payable to me.

JL



[ Reply to This | # ]