The Museum of HP Calculators

HP Forum Archive 19

[ Return to Index | Top of Index ]

Needed - a little help with my HP-19BII
Message #1 Posted by Palmer O. Hanson, Jr. on 15 May 2010, 9:40 p.m.

Earlier this year I purchased a 19BII which came with a manual and I decided to try to use it in algebraic mode. Of course, what I soon found is that the algebraic mode isn't algebraic at all but operates in what I have always called adding machine arithmetic; i.e, without the old "my dear aunt Sally" precedence. I knew that machines developed for the business community have often been mechanized that way for some reason. Page 120 of the Fifth Edition of Wlodek's book explains that by saying that the HP business models "... all work without precedence, assuming that business users do not bother with fancy ideas like this.", i.e., with precedence. Most of the TI business models also operate without algebraic precedence where the exception that I am most familiar with is the old MBA.

But then I discovered that the sequence

5 + 3 y^x 2 =

yielded 64, not the value of 14 that I expected. That occurs because the y^x function causes the 5 + 3 to be executed. So I ask, "Why do they do it that way?"

      
Re: Needed - a little help with my HP-19BII
Message #2 Posted by Martin Pinckney on 15 May 2010, 9:53 p.m.,
in response to message #1 by Palmer O. Hanson, Jr.

Quote:
Wlodek's book explains that by saying that the HP business models "... all work without precedence, assuming that business users do not bother with fancy ideas like this.", i.e., with precedence...

So I ask, "Why do they do it that way?"


We've had some discussions about this in the past. I maintain that the idea expressed above, that algebraic precedence is somehow a "fancy idea", is nonsense. Do business users not go to high school? This is just basic math! In other words, the calculator models that work like this are just giving incorrect results, IMO.
            
I agree!!!! (N.T.)
Message #3 Posted by Vieira, Luiz C. (Brazil) on 15 May 2010, 9:54 p.m.,
in response to message #2 by Martin Pinckney

Edited: 15 May 2010, 10:48 p.m.

            
Re: Needed - a little help with my HP-19BII
Message #4 Posted by Palmer O. Hanson, Jr. on 16 May 2010, 12:07 p.m.,
in response to message #2 by Martin Pinckney

Quote:
... the calculator models that work like this are just giving incorrect results, IMO.
That is not at all true! All the user has to do is to understand how his machine works, whichis also true of RPN and Algebraic.

But I admit that I may not have framed my question appropriately. It is generally understood that many of the machines targetted for business users are mechanized without precedence since that is how the old mechanical desktops worked and many business users are comfortable with that. What surprised me was that the y^x function operates at the same level as the four arithmetic operators and I wondered why.

                  
Re: Needed - a little help with my HP-19BII
Message #5 Posted by Martin Pinckney on 16 May 2010, 9:49 p.m.,
in response to message #4 by Palmer O. Hanson, Jr.

Quote:
All the user has to do is to understand how his machine works, which is also true of RPN and Algebraic.
Of course I understand this. I did not mean to say the machine is malfunctioning, but I still say it is giving wrong answers! Luiz stated what I believe about this very well, with his test example. I still maintain that algebraic precedence is a universal standard that applies to business math the same as other disciplines.
                        
Re: Needed - a little help with my HP-19BII
Message #6 Posted by Palmer O. Hanson, Jr. on 16 May 2010, 10:02 p.m.,
in response to message #5 by Martin Pinckney

Quote:
I still maintain that algebraic precedence is a universal standard that applies to business math the same as other disciplines.
Algebraic precedence does apply to to business math the same as other disciplines when it comes to writing equations on paper. But it doesn't apply to the way many business people expect calculators to work. The proof of my statement is the "algebraic" methodology -- really adding machine arithmetic -- which is used whereever "algebraic" is offered as an option in business calculators manufactured by HP.
                              
Re: Needed - a little help with my HP-19BII
Message #7 Posted by Martin Pinckney on 16 May 2010, 10:37 p.m.,
in response to message #6 by Palmer O. Hanson, Jr.

I guess we will just not agree on this. I do understand your point:

Quote:
Algebraic precedence does apply to to business math the same as other disciplines when it comes to writing equations on paper. But it doesn't apply to the way many business people expect calculators to work.
To this I respond with a paraphrase of your own question: So I ask, "Why do businessmen expect it that way?" Your answer seems to be that it's because adding machines used to work that way. So we are going to perpetuate incorrect math operations forever, just because early machines were too simple mechanically to do it correctly?
                                    
Re: Needed - a little help with my HP-19BII
Message #8 Posted by bill platt on 17 May 2010, 2:42 a.m.,
in response to message #7 by Martin Pinckney

Yep. Another example: the cheap "4 function" calculators all have a weird chain arithmetic system built-in. And they too have no parenthesis. Try essentially any of them, and they have the weird chain arithmetic. So it isn't merely business ones that are screwy.

I'm sure we can find other examples of unneeded "backwards compatibility" in other (perhaps non-computing) products...I just can't think of any...

                                    
Re: Needed - a little help with my HP-19BII
Message #9 Posted by Palmer O. Hanson, Jr. on 17 May 2010, 4:12 a.m.,
in response to message #7 by Martin Pinckney

Quote:
So we are going to perpetuate incorrect math operations forever, just because early machines were too simple mechanically to do it correctly?
Yes. We will continue to see "algebraic" without precedence in business machines as long as the gods at HP and TI and whereever else continue to believe, whether it's actually true or not, that business users aren't comfortable with precedence. That's business.
      
Re: Needed - a little help with my HP-19BII
Message #10 Posted by David Hayden on 16 May 2010, 8:16 a.m.,
in response to message #1 by Palmer O. Hanson, Jr.

It sounds to me like they're just being consistent. If the calculator doesn't honor precedence rules then it should do so consistently. I assume that if you enter 5+3*2 you get 16.

It's probably a hold over from the old (REALLY old) mechanical adding machines where there was no precedence. Business people got used to it and stuck. One could also argue that it's an easier to remember rule, I suppose.

      
Re: Needed - a little help with my HP-19BII
Message #11 Posted by Bart (UK) on 16 May 2010, 12:16 p.m.,
in response to message #1 by Palmer O. Hanson, Jr.

Nowadays HP call it "chain calculation" mode I think. I actually have a business friend that WANTS it to work that way. His words "If I want to sell a pack of 10 units and a pack of 5 units at Ģ5 per unit, I want to do 10+5*5= and get 75, not 35". This may be more linked to habit as until recently he had a '70s Sanyo without "operator precedence".

Moral of the story: use RPN - no such confusion :)

Edited: 16 May 2010, 12:18 p.m.

            
Re: Needed - a little help with my HP-19BII
Message #12 Posted by Thomas Radtke on 17 May 2010, 11:59 a.m.,
in response to message #11 by Bart (UK)

Quote:
Moral of the story: use RPN - no such confusion :)
Try "1 Enter 2 Enter +" on a 32S and on a 20b in RPN mode. Confused? ;-).

Not to mention that you have read the manual to learn about the stack size.

                  
Re: Needed - a little help with my HP-19BII
Message #13 Posted by Martin Pinckney on 17 May 2010, 12:32 p.m.,
in response to message #12 by Thomas Radtke

Quote:
Try "1 Enter 2 Enter +" on a 32S and on a 20b in RPN mode. Confused? ;-).


Yes, I am. Can someone explain why they work this way? "1 Enter 2 +" gives the expected answer, but "1 Enter 2 Enter +" does not. At least I would expect the operator to act on the last two stack entries, but instead it acts on the last stack entry twice!
                        
Re: Needed - a little help with my HP-19BII
Message #14 Posted by Don Shepherd on 17 May 2010, 1:25 p.m.,
in response to message #13 by Martin Pinckney

Yes, the 20b (and 30b, BTW) work this way. The 20b/30b are hybrid RPL/RPN, and this behavior is RPL-ish, I am told. If you ever plan to write programs for the 30b (assuming you can actually buy the 30b one day; it was released in January but has not been available for purchase for months now), you need to be aware of this non-RPN behavior.

                        
Re: Needed - a little help with my HP-19BII
Message #15 Posted by Thomas Radtke on 17 May 2010, 1:42 p.m.,
in response to message #13 by Martin Pinckney

Very simple: As Don said, the 20b acts partially like a RPL calculator which has an extra register for entering numbers where earlier RPN calculators don't, so you had to enter numbers directly into the x register.

I bet, if memory wouldn't have been an issue in terms of cost in the early 70th, the 35 would have become an algebraic or RPL calculator.

Edited: 17 May 2010, 1:44 p.m.

                              
Re: Needed - a little help with my HP-19BII
Message #16 Posted by Martin Pinckney on 17 May 2010, 3:50 p.m.,
in response to message #15 by Thomas Radtke

No, you've got it backwards. (Unless I am missing something). My 32sii gives 4 as a result to this simple problem; my 48sx give 3, the expected answer.

                                    
RPN or RPL ?
Message #17 Posted by Gene Wright on 17 May 2010, 4:33 p.m.,
in response to message #16 by Martin Pinckney

The question hinges on whether you think in RPL or RPN.

RPL requires an ENTER to terminate a command line input.

So, 1 ENTER 2 ENTER + gives 3 since the ENTER only terminates the command line and does not specifically DUP the stack. Note: the RPL machines do an implied ENTER before an arithmetic operator so that if you actually type 1 ENTER 2 + you still get 3.

On **pure** RPN machines, ENTER terminates DIGIT entry AND pushes the stack.

So 1 ENTER 2 ENTER + gives 4 on those machines.

Issue with the 20b / 30b is that they are a hybrid.

A command line approach has been placed upon the old 4-level RPN stack.

ENTER after a number entry does NOT push the number into stack level 2 aka Y.

So, you now have 3 options.

Original RPN

Original RPL

The RPN / RPL hybrid.

                                          
Re: RPN or RPL ?
Message #18 Posted by Martin Pinckney on 17 May 2010, 4:48 p.m.,
in response to message #17 by Gene Wright

Gene, thanks for the explanation. I think I actually understand it, mostly.

Only one piece of information I lack: the result from 20b/30b. Knowing this should help me understand the difference in how the hybrids function.

                                                
Re: RPN or RPL ?
Message #19 Posted by Gene Wright on 17 May 2010, 5:52 p.m.,
in response to message #18 by Martin Pinckney

The 20b / 30b works more like the RPL.

1 ENTER 2 ENTER + returns 3, not 4 as on "pure" RPN machines.

1 ENTER 2 + returns 3.

                                                      
Re: RPN or RPL ?
Message #20 Posted by Martin Pinckney on 17 May 2010, 6:45 p.m.,
in response to message #19 by Gene Wright

Well, then, as an RPN "outsider" (or better to say an ALG user), I have to conclude that I like the RPL and hybrid designs better than RPN. Just makes more sense to me.

BTW, I think what you call "pure" RPN isn't pure at all, at least not pure postfix. STO, RCL, and XEQ come to mind. Just as traditional ALG isn't pure infix. RPL, on the other hand, is pure postfix (48 series), or pure infix (38G), at least as far as I can tell.

                                                            
Re: RPN or RPL ?
Message #21 Posted by Bart (UK) on 17 May 2010, 7:01 p.m.,
in response to message #20 by Martin Pinckney

Quote:
Well, then, as an RPN "outsider" (or better to say an ALG user), I have to conclude that I like the RPL and hybrid designs better than RPN. Just makes more sense to me.
I started using HPs with the 28S, which is RPL. It also has the advantage of an "unlimited" stack (as memory allows), thus no "dropping off the top" of arguments.
                                    
Re: Needed - a little help with my HP-19BII
Message #22 Posted by Thomas Radtke on 17 May 2010, 4:40 p.m.,
in response to message #16 by Martin Pinckney

What you expect is a result of what you know ;-). If you know RPN, you expect 4. 1 ist entered to x, "Enter" shifts it up to y (and y to z and so on), but keeping x (it's not a rotation). "2" is entered, overwriting 1. Same procedure after the second Enter, so in the end, both x and y registers contain 2, z contains 1. That's how RPN always worked and a result of x being used as entry register. On RPL machines, entries are written to a temporary register unless Enter is pressed. Now, if you press e.g. a binary operator before finishing an entry, the content of this temp register is copied to whatever the stack pointer points at. In contrast to RPN, RPL uses a clutch to show some convenience. It absolutely needs an Enter after each entry, and does it itself when the user refuses to do so.

RPN is very straightforward.

                                          
Re: Needed - a little help with my HP-19BII
Message #23 Posted by Martin Pinckney on 17 May 2010, 5:01 p.m.,
in response to message #22 by Thomas Radtke

Quote:
What you expect is a result of what you know ;-). If you know RPN, you expect 4...

RPN is very straightforward.


Can't argue with the first statement above. I did not "cut my teeth" on RPN, as most of you have, nor do I use it very often.

Regarding the second statement, though, my thinking is evolving. When I first started using my 48sx, I found it very confusing to use. The more I use it, the more consistent I find its construct to be, albeit in some respects not particularly intuitive.

                  
Re: Needed - a little help with my HP-19BII
Message #24 Posted by Bart (UK) on 17 May 2010, 6:58 p.m.,
in response to message #12 by Thomas Radtke

Ah, yes, I forgot about the RPN/RPL difference. Interesting that the 20b has RPL behaviour. I started my "HP life" with the 28S, thus RPL. I had to get used to "stack lift" when I purchased the 35s :)

      
Soooo....
Message #25 Posted by Vieira, Luiz C. (Brazil) on 16 May 2010, 1:30 p.m.,
in response to message #1 by Palmer O. Hanson, Jr.

.... based in all thatīs been written, if I am taking an examination and I have to calculate

5 + 3 yx 2

I must ask the teacher what kind of result he wants or should I write:

"If I am a businessman or if I am using a financial calculator, 5 + 3 yx 2 yields 64, but if I am a professional from any other scientific area or if I am using a 'regular' (?) calculator, 5 + 3 yx 2 yields 14."

I'm confused... isn't math an exact science?

Cheers.

Luiz (Brazil)

            
Re: Soooo....
Message #26 Posted by Dave Shaffer (Arizona) on 16 May 2010, 5:34 p.m.,
in response to message #25 by Vieira, Luiz C. (Brazil)

Quote:
I'm confused... isn't math an exact science?

Math may be an exact science (in which case I think ALL of us here, and in every math class on earth, would give the answer 14 to Palmer's expression), but making calculators is clearly not!

                  
Re: Soooo....
Message #27 Posted by Palmer O. Hanson, Jr. on 16 May 2010, 9:53 p.m.,
in response to message #26 by Dave Shaffer (Arizona)

Quote:
Math may be an exact science (in which case I think ALL of us here, and in every math class on earth, would give the answer 14 to Palmer's expression), but making calculators is clearly not!
Here is a quotation from TI's old The Great International Math On Keys Book published back in 1976:
Quote:
Mathematics is a science which is persnickety about some things. One of them is it never permits two different answers to the same series of computations. Because of this requirement -- one solution for any computation -- mathematicians have established a set of accepted (and universal) rules when mixed operations are in one calculation. For example, the problem

3 + 10 - 2 x 14 / 7 = ?

has only one answer! (Know what it is? It's 9.)

... Not all calculators will do this. ...


We all know the HP position on the use of RPN, namely that it's use avoids confusion.

If HP and TI and Casio as well take such strong positions on the right way to do things then the obvious question is "Why are they making calculators which use adding machine arithmetic?"

The answer is simple. Mathematics may be an exact science, but making and selling calculators is a BUSINESS.

While I am on the subject a recent thread told me that the latest version of the HP-12C (the C++ is it?) has an algebraic option. Can anyone tell me if the algebraic option uses algebraic precedence or does it use adding machine arithmetic.

Palmer

                        
Re: Soooo....
Message #28 Posted by bill platt on 16 May 2010, 10:14 p.m.,
in response to message #27 by Palmer O. Hanson, Jr.

Take a look at Craig Finseth's HPdatabase:

http://www.finseth.com/hpdata/hp12cpt.php

                        
Re: Soooo....
Message #29 Posted by Martin Pinckney on 16 May 2010, 10:17 p.m.,
in response to message #27 by Palmer O. Hanson, Jr.

Quote:
While I am on the subject a recent thread told me that the latest version of the HP-12C (the C++ is it?) has an algebraic option. Can anyone tell me if the algebraic option uses algebraic precedence or does it use adding machine arithmetic.
Palmer, I don't think it's the 12c+, but the 12c Platinum, and 12c Platinum 25th Anniversary Edition, that have the algebraic mode. That said, although I did own one for a short time, I cannot remember how the ALG mode worked.

Seeing Bill Platt's post, I went to Finseth's site. He states:

Quote:
Algebraic mode has no precedence. It also has no parentheses.
While the original Platinum (all silver) did not have parentheses, the latest version (Silver and black) and the 25th Anniversary Edition, do have them.

Edited: 16 May 2010, 10:25 p.m.

      
Allow me (again), please?
Message #30 Posted by Vieira, Luiz C. (Brazil) on 17 May 2010, 12:02 a.m.,
in response to message #1 by Palmer O. Hanson, Jr.

Hi, all.

Back in the 80īs, when I started dealing with computers, it took me a willing to know about the history of these tricky machines. I was just an electrical engineer student, and at that time, under military government (final years), Brazilian educational system was 'shacked' by new paradigms and engineers were not exactly encouraged to go beyond their own Cartesian thoughts. I failed to do so and went ahead studying whatever I could.

I clearly remember searching for computers' design timeline and reading about Blaise Pascal and his contributions in the field. Something in particular called my attention and I quote Wikipedia by helping me with the historical fact:

Quote:
In 1642, in an effort to ease his father's endless, exhausting calculations, and recalculations, of taxes owed and paid, Pascal, not yet nineteen, constructed a mechanical calculator capable of addition and subtraction, called Pascal's calculator or the Pascaline.

In an effort of helping his father with taxes figures and calculations, Pascal constructed a mechanical addition/subtraction calculator. If I remember it well, I red that the Pascaline was the first desktop calculator ever, and it was designed and built for... financial calculations!

Cannot say anything about Pascaline precedence because it provided only addition and subtraction, but if the above mentioned facts are correct, businessmen may actually care less for precedence for their first calculator did not provide it.

What do we know...

Luiz (Brazil... and still without answers)

Edited: 17 May 2010, 10:57 a.m.

      
Re: Needed - a little help with my HP-19BII
Message #31 Posted by Steve Perkins on 18 May 2010, 12:36 p.m.,
in response to message #1 by Palmer O. Hanson, Jr.

Historically, a reason that traditional RPN worked as stated was apparently to allow simple squaring or doubling of a value in the X register.

3 ENTER *
   or
3 ENTER +  (less keystrokes than 3 ENTER 2 *)

The HP-35 and HP-80 didn't even provide an X^2 key!

The paradigm survived in subsequent RPN machines. Pressing ENTER pushed the stack, but left a temporary copy of the X register still in X for convenience (and because something had to be there).

If the user started entering digits, the temporary value was overwritten. If they executed an operation it was utilized.


[ Return to Index | Top of Index ]

Go back to the main exhibit hall