The Museum of HP Calculators

HP Forum Archive 19

 Does the HP 10B calculator not support Order of Operation?Message #1 Posted by David Adams on 2 Aug 2010, 10:34 a.m. Hi, I own the HP 10B calculator which is listed as a business/scientific calculator. I noticed when entering simple algebraic equations, the calculator does not implement the order of operation feature which dictates multiplication/division operations are done prior to addition/subtraction. (ie. entering 1+2x3 result in 9, when it should be 7). Does this calculator not support this at all or does it have to be configured first? Thanks.

 Re: Does the HP 10B calculator not support Order of Operation?Message #2 Posted by Tim Wessman on 2 Aug 2010, 11:01 a.m.,in response to message #1 by David Adams The 10b and the later 10bII only implement chain algebraic, which evaluates as things are entered as you've noticed. No order of operations. Sorry. :-( TW

 Re: Does the HP 10B calculator not support Order of Operation?Message #3 Posted by Walter B on 2 Aug 2010, 12:44 p.m.,in response to message #1 by David Adams David, IIRC, some extended discussions about RPN, ALG and Chain mode took place in this very forum in the past. There were also quite nasty remarks about the reasons for Chain mode in business/financial calculators (instead of ALG supporting the common mathematical operator precedence). Many comments from technical/scientific people. Must have been past 2008 IIRC. It's a pity, but I don't find them right now anymore d;-) Edited: 2 Aug 2010, 12:50 p.m.

 Re: Does the HP 10B calculator not support Order of Operation?Message #4 Posted by David Hayden on 2 Aug 2010, 1:14 p.m.,in response to message #1 by David Adams Hi David, The "order of operations" problem is one of the great reasons to use one of HP's calculators that supports RPN entry instead. RPN is a much more natural way to evaluate an expression and you never have to worry about the order of operations. You may want to consider an HP 20b or the much faster 30b instead. You can learn more about RPN here.

 Re: Does the HP 10B calculator not support Order of Operation?Message #5 Posted by Martin Pinckney on 2 Aug 2010, 1:53 p.m.,in response to message #1 by David Adams Quote: I own the HP 10B calculator which is listed as a business/scientific calculator. When you say "listed as a business/scientific calculator", do you mean by HP? My 10b manual only refers to it as a "business calculator". MANY eB** sellers refer to this model (and the 12c or 17b, etc.) as "scientific", but that is just ignorance, IMO.

 Re: Does the HP 10B calculator not support Order of Operation?Message #6 Posted by Palmer O. Hanson, Jr. on 3 Aug 2010, 3:28 a.m.,in response to message #1 by David Adams David: The 10B is a capable business calculator. It can not be considered a scientific calculator since the trigonometric functions are not available. The 10b uses the the type of algebra that is generally accepted as appropriate for business calculators. It does not provide order of operation. The reason that the business community accepts that methodology has never been clear to me. Some say it is because the operation mimics that of the old mechanical desktop calculators. Others suggest that business users have trouble with order of operation or "... aren't interested in fancy ideas like ..." order of operation. You can buy calculators which don't implement order of operation from H-P, TI and Casio but you will have a hard time finding them which offer the generally accepted scientific functions such as the trigonometrics and hyperbolics. In this forum you will always get a recommendation to use RPN as a more natural way of doing arithmetic. I have never found that to be so, probably because I had become proficient in higher order languages such as BASIC and FORTRAN in computers before obtaining my first electronic calculator. RPN is actually a lower order language akin to what I knew as machine language in computers. If you are comfortable with order of operation and the use of parentheses in evaluating equations you will not have a problem with calculators which use those methodologies and which are widely available from TI and Casio and in a few models from H-P. If you elect to go to RPN you should be aware of the need to manage the stack unless you limit yourself to the simplest kind of arithmetic. Otherwise, you will eventually encounter stack overflow which will result in incorrect answers for apparently innocuous calculations. The "fancy ideas" quote is from page 120 of Wlodek Mier-Jedrzejowicz's A Guide to HP Handheld Calculators and Computers. Palmer Edited: 3 Aug 2010, 11:07 a.m.

 Re: Does the HP 10B calculator not support Order of Operation?Message #7 Posted by Martin Pinckney on 3 Aug 2010, 1:52 p.m.,in response to message #6 by Palmer O. Hanson, Jr. Quote: In this forum you will always get a recommendation to use RPN as a more natural way of doing arithmetic. I have never found that to be so... If you elect to go to RPN you should be aware of the need to manage the stack unless you limit yourself to the simplest kind of arithmetic. Otherwise, you will eventually encounter stack overflow which will result in incorrect answers for apparently innocuous calculations. At the risk of inflaming, I must say, thank you, Palmer! (from someone who gave up trying to understand this fascination with RPN).

 Re: Does the HP 10B calculator not support Order of Operation?Message #8 Posted by bill platt on 3 Aug 2010, 2:52 p.m.,in response to message #7 by Martin Pinckney Well, the great thing about that low-level code that is RPN is that it doesn't do anything automatic for you (except duplicating the T-register). You control precedence and everything else. The only sticky wicket is stack depth. In the 70s, compared to the then infix/postfix mix that was "algebraic" calculators, RPN was elegant. Today, not so much. But look what happened in the 80 and 90s and beyond--a rash of different versions of algebraics came out--all with their own rules--so that a user switching from one to the other could easily fall into a hole. Not so with elegant, simple RPN. Of course I happen to like some of the albebraic designs very much! I am a dyed in the wool RPN who is not afraid of the "dark side." Yopu can probably find posts of mine here from years back, before I learned to appreciate the Algebraic versions. SO Ironically I learned about AOS by reading this forum!

 Re: Does the HP 10B calculator not support Order of Operation?Message #9 Posted by Katie Wasserman on 3 Aug 2010, 3:44 p.m.,in response to message #7 by Martin Pinckney I think that HP has recognized that not everyone loves RPN too (although i do). All of the recent HP RPN calculators also allow the user to switch to some form of infix operator syntax. The only exception that comes to mind is the 12C ARM-based machine, but that's not really a "new" calculator.

 Re: Does the HP 10B calculator not support Order of Operation?Message #10 Posted by Palmer O. Hanson, Jr. on 3 Aug 2010, 9:42 p.m.,in response to message #9 by Katie Wasserman Katie: You wrote: Quote: All of the recent HP RPN calculators also allow the user to switch to some form of infix operator syntax. The only exception that comes to mind is the 12C ARM-based machine, but that's not really a "new" calculator. Unfortunately HP hasn't done a very good job of offering an alternate algebraic mode. Part of the problem is that they run out of keyboard space. As a result the HP-33s has parentheses a second functions which is totally unacceptable in an algebraic mode. The HP-35s offers a curious single parentheses key which enters both an opening an closing parentheses which is a concept which is largely foreign to algebraic users. They are a lot like RPN users in one respect. They don't like change. This all reminds me of something that occurred back in the eighties when I was publishing a newsletter for TI calculators. A reader wondered if my attachment was to TI or to algebraic and asked "Would I buy an algebraic if HP offered it?" I wrote back and said no. But I added that I wouldn't buy an RPN machine if TI made it either. I supported my answer with the following: Suppose that I wanted to buy some bottles of really fine scotch whiskey. Would I go to the Jack Daniels distillery in Kentucky to do that? Palmer

 Re: Does the HP 10B calculator not support Order of Operation?Message #11 Posted by Walter B on 3 Aug 2010, 5:04 p.m.,in response to message #7 by Martin Pinckney I concur with Katie. Nowadays, RPN is so exotic for over 95% of the target population of pocket calculator users that even HP has to offer ALG additionally at least - and hope to gain some young RPN aficionados this way. One advantage RPN still keeps today is it allows monitoring all intermediate results in a calculation most easily, supporting the understanding. Stack depth 4 with top level repetition, however, was cutting edge technology when the HP-35 was launched. As Palmer stated, however, 4 stack levels require stack management in real life calculations. This extra effort was justified as long as memory was expensive, but it is no more. 6 levels will allow for straightforward smooth and secure solving all real world formulae IMO. 8 levels will even take care of problems I did never encounter so far. Still, such a stack stays small enough to be handled easily. Add an operation FILL copying x into all stack registers in 1 step, so calculations using constants stay as known. Rv and R^ may be dropped instead. IMHO the one and only reason for keeping stack depth 4 is tradition. Or, less friendly: "We stick to this way because we've always done it this way." And for the dying species of old RPN users (= us!) HP may offer a settable 4-level "compatibility mode" if it pays. Else we have to recode our favourite routines, so HP will keep our brains trained d;-) We shall be thankful :-) FWIW, Walter Edited for emphasizing the message and correcting some expressions. Edited: 4 Aug 2010, 6:56 a.m. after one or more responses were posted

 Re: Does the HP 10B calculator not support Order of Operation?Message #12 Posted by Tommy on 4 Aug 2010, 5:53 a.m.,in response to message #11 by Walter B Quote: 6 levels will allow for smooth and secure solving all real world formulae IMO. I would get OVERFLOW myself. 4 level stack is OK with me. I rather use STO/RCL when the calculation is complicated/Tommy

 Re: Does the HP 10B calculator not support Order of Operation?Message #13 Posted by Walter B on 4 Aug 2010, 7:54 a.m.,in response to message #12 by Tommy Tommy, You are free to use as many general purpose registers as you like. By "straightforward smooth and secure" I wanted to say you may deal with an arbitrary real world formula trouble-free without using such registers. You don't need to memorize the contents of all stack registers. They are paid to store your data reliably - and recall them when their turn has come in your calculation.

 Re: Does the HP 10B calculator not support Order of Operation?Message #14 Posted by Bart (UK) on 4 Aug 2010, 8:33 a.m.,in response to message #6 by Palmer O. Hanson, Jr. Quote: Otherwise, you will eventually encounter stack overflow which will result in incorrect answers for apparently innocuous calculations. I've never had that problem, regardless of the complexity of operation. With DUPs ROLLs etc, I have always been a happy camper.Today I tried using the Windows calculator with parentheses and got hopelessy lost (the fact that it doesn't have e^x didn't help - you've got to use inverse-Ln). I guess it depends what you "grew up" with, even though I had a Sharp EL-506P before my HP-28C. Bart

 Re: Does the HP 10B calculator not support Order of Operation?Message #15 Posted by Palmer O. Hanson, Jr. on 4 Aug 2010, 9:36 p.m.,in response to message #14 by Bart (UK) Quote: I've never had that problem, regardless of the complexity of operation. With DUPs ROLLs etc, I have always been a happy camper. Have you tried the old problem [(3+1)(4+3)+(2+6)(4+6)]/[(2+3)(2+1)+(3+5)(4+2)] on a 4 level RPN machine.

 Re: Does the HP 10B calculator not support Order of Operation?Message #16 Posted by Bart (UK) on 5 Aug 2010, 5:33 a.m.,in response to message #15 by Palmer O. Hanson, Jr. The secret is in my last sentence, I started my HP life with the first RPL machine ;). I have never got on with algebraics since. I later replaced the 28C with the 28S. When that broke a few years ago, I got the 35S and had to learn about stack lift and the limits of a 4-level stack. I now have a 50G too.I must add that I do occasionally use the modern formula display calculators. They are much easier to use, you can see the formula and go back to check for mistakes.Getting back to your example, keeping track of the stack is as much effort as keeping track of parentheses. On simpler scientifics when formulas start getting that long I prefer to use the memory function. Multiple storage registers are very useful as found on HPs from as early as the HP-45. It was another thing that led to my frustration of the Windows calculator (It is a newly setup PC at work and I have since installed Thomas Okken's Free42). It's also a reason I like the 20S (the HP algebraic that I did use for some years), I never used parentheses on it because with 10 storage registers I didn't have to. Why bother with something I can't even spell? :) (I don't even know if I've spelt "parentheses" correctly every time in this message).

 Re: Does the HP 10B calculator not support Order of Operation?Message #17 Posted by Palmer O. Hanson, Jr. on 5 Aug 2010, 9:07 p.m.,in response to message #16 by Bart (UK) Quote: Getting back to your example, keeping track of the stack is as much effort as keeping track of parentheses. Parentheses with an algebraic computer work just like parentheses in textbook equations. There is no need to keep track of them when working with equations such as the old, supposedly hard for algebraics, Mach Number equation. You just enter them when you encounter them.

 Re: Does the HP 10B calculator not support Order of Operation?Message #18 Posted by Bart (UK) on 6 Aug 2010, 4:49 a.m.,in response to message #17 by Palmer O. Hanson, Jr. Quote: Parentheses with an algebraic computer work just like parentheses in textbook equations. Hi Palmer, as my intro to calculators was at university, textbooks were not allowed in exams. Formulas had to be remembered. Working out of my head, I never bothered to remember a formula like a parrot, but rather how the parts of the fomula were developed and fitted together. Thus an RPL calculator offered the best possible solution for me, I could work out the parts and then put them together in the correct fashion. Similarly with the 20S and it's 10 memories, I can work out each part, store it in it's own memory and then recall as necessary to form the whole. It's like having a 10-level stack. I do not scribble down my formulas and work through them as written, so for me parentheses is a hopeless case. So, bottom line: it's all about WHAT SUITS YOU BEST. I think both HP and TI did a disservice by fuelling the "fight" by attempting to proclaim their method better and finding "examples" to support it. It has allowed people to be discouraged to try "the other way". I believe everybody should be actively ancouraged to try different methods so that they can decide on what's best for them. HP has seen the light in some ways by offering alternate input modes on some of their calculators.

 Re: Does the HP 10B calculator not support Order of Operation?Message #19 Posted by Mark Storkamp on 5 Aug 2010, 9:35 a.m.,in response to message #15 by Palmer O. Hanson, Jr. And the TI-30 had what, 4 pending operations? That must also have been a limitation since newer models boasted 6 pending operations. The key was in knowing the limitations of the tools you are using, and knowing that they don't do the thinking for you.

 Re: Does the HP 10B calculator not support Order of Operation?Message #20 Posted by Martin Pinckney on 5 Aug 2010, 12:29 p.m.,in response to message #19 by Mark Storkamp Quote: And the TI-30 had what, 4 pending operations? That must also have been a limitation since newer models boasted 6 pending operations. Way back when the TI-59 had 8 levels of pending operations.

 Re: Does the HP 10B calculator not support Order of Operation?Message #21 Posted by Walter B on 5 Aug 2010, 5:18 p.m.,in response to message #20 by Martin Pinckney Quote: [(3+1)(4+3)+(2+6)(4+6)]/[(2+3)(2+1)+(3+5)(4+2)] Done straightforward with a 6 level stack in RPN:``` x y z a b t 3 ENTER 1 1 3 - - - - + 4 ENTER 3 3 4 3+1 - - - + * 2 ENTER 6 6 2 ()() - - - + 4 ENTER 6 6 4 2+6 ()() - - + * + num 2 ENTER 3 3 2 num - - - + 2 ENTER 1 1 2 2+3 num - - + * 3 ENTER 5 5 3 ()() num - - + 4 ENTER 2 2 4 3+5 ()() num - + * + den num / result``` That's why I claimed what I did above. Quote: Way back when the TI-59 had 8 levels of pending operations. Hmmh, and you tell me TI's main competitor never went beyond 3 levels of pending operations? And they wonder why they fell behind?

 Re: Does the HP 10B calculator not support Order of Operation?Message #22 Posted by Palmer O. Hanson, Jr. on 5 Aug 2010, 8:56 p.m.,in response to message #19 by Mark Storkamp Quote: And the TI-30 had what, 4 pending operations? That must also have been a limitation since newer models boasted 6 pending operations. The key was in knowing the limitations of the tools you are using, and knowing that they don't do the thinking for you. Yes, the TI-30 had only four pending operations. The old Mach Number equation was proposed by HP as a problem easily solved with RPN but difficult on an algebraic. But the problem requires only four pending operations. Thus, the TI-30, the least capable of the TI scientifics, was able to easily handle what HP thought was a difficult problem for algebraics. If HP had wanted to make the equation too difficult for the TI-30 to handle with a straightforward left to right entry all they had to do was interchange the two bracketed quantities and five pending operations would have been required.

 Re: Does the HP 10B calculator not support Order of Operation?Message #23 Posted by Mark Storkamp on 4 Aug 2010, 9:39 a.m.,in response to message #6 by Palmer O. Hanson, Jr. Quote: In this forum you will always get a recommendation to use RPN as a more natural way of doing arithmetic. I have never found that to be so, probably because I had become proficient in higher order languages such as BASIC and FORTRAN in computers before obtaining my first electronic calculator. RPN is actually a lower order language akin to what I knew as machine language in computers. If RPN calculators only had add, subtract, shift and mask operations, I'd agree with you. And the fact that LISP is AFAIK PN, and not exactly a low level language, I'm not sure I can agree with your conclusions. As someone who learned Fortran IV, BASIC, and had a TI-30 before getting a 34C, I think RPN is more natural. But then, anecdotal evidence does not a proof make.

Go back to the main exhibit hall