The Museum of HP Calculators

HP Forum Archive 14

[ Return to Index | Top of Index ]

Why did HP get rid of stack clear?
Message #1 Posted by Tom on 21 June 2004, 4:46 p.m.

Has anybody noticed that HP rpn calculators no longer have a simple stack clear command? This was a function that would clear all four registers of the stack. They used to have that on the HP 21, 25, 27, 31E, and the 33E/C. On the 11C and 15C you could fake the stack clear by hitting clear sigma but that would clear the stat registers as well. However on the 32S and 32SII it gets confusing because clear sigma only clears the stat registers but doesn't clear the stack. Even the new grotesque-looking monstrosity with the atom-sized decimal point called the 33S doesn't have a stack clear command. What happened to HP, why is their design getting lousy?

      
Re: Why did HP get rid of stack clear?
Message #2 Posted by Bram on 21 June 2004, 5:06 p.m.,
in response to message #1 by Tom

Quote:
Has anybody noticed ...

I have.
HP-21 has a clear stack command and my second model, HP-29C, has not. I then thought it 100% plausible to get rid of it, because understanding RPN, I knew that CLR has no use at all. Even in program mode I cannot possibly think of a situation where CLR would be handy.
OK, I must confess that I sometimes used the keystroke when "learning" RPN and hence examining the stack contents, but just because the command was there. Wouldn't it have been, I'd have used 0 enter enter enter instead.
By the way, HP-29C's clear sigma command only clears the stat registers and not the stack. I think that's the only right way to do. I'm surprised that some others do otherwise. Now *thats's* confusing, isn't it?

            
Re: Why did HP get rid of stack clear?
Message #3 Posted by Massimo (Italy) on 21 June 2004, 7:17 p.m.,
in response to message #2 by Bram

Quote:
HP-21 has a clear stack command and my second model, HP-29C, has not. I then thought it 100% plausible to get rid of it, because understanding RPN, I knew that CLR has no use at all. Even in program mode I cannot possibly think of a situation where CLR would be handy.

Right, however (p. 44 of the Owner's Handbook): "When the calculator is switched on, the Y, Z, and T registers are cleared to 0.00. The X-register is maintained by Continuous Memory."

You pratically had a CLST (except for the X register) each time you switched off then on the calculator.

This leads to an(some) obvious question(s): why did they preserved only X? So you knew that your last result was not lost? Was it marketing for the (then) new Continuous Memory?

A couple pages later (under "Clearing the X-Register"): "Altough it may be comforting, it is never necessary to clear the diplayed X-register when starting a new calculation.This will become obvious when you see how old results in the stack are automatically lifted by new entries."

I think this is the key: comfort.
Like starting a new calculation on a blank page. You could always use some free space on a previous page or a margin but all that white space easies the task.
Isn't it?

That said I must confess that my standard housekeeping routine on each of my 41s includes a CLST besides flag settings and the like... I love all those zeroes! :-)

Greetings,
Massimo

                  
Re: Why did HP get rid of stack clear?
Message #4 Posted by Bram on 22 June 2004, 9:57 a.m.,
in response to message #3 by Massimo (Italy)

Quote:
This leads to an(some) obvious question(s): why did they preserved only X? So you knew that your last result was not lost? Was it marketing for the (then) new Continuous Memory?

I tried to answer this question in one of my HP stories

      
Re: Why did HP get rid of stack clear?
Message #5 Posted by Barltleby the Scrivener on 21 June 2004, 5:07 p.m.,
in response to message #1 by Tom

0 ENT ENT ENT

      
Re: Why did HP get rid of stack clear?
Message #6 Posted by Garth Wilson on 21 June 2004, 5:23 p.m.,
in response to message #1 by Tom

What do you use the "clear stack" instruction for? I suppose I've used my 41cx well over 1000 hours in the last 18 years and didn't know it had such an instruction until I checked just now, because I've never needed it. Part of the idea and efficiency of a stack is that you don't care what's beyond the levels that are relevant at the moment. Sometimes it would be nice if there were at least a couple more levels though, making 6 or more. This would be more useful for programming than for hand calculations though.

            
Re: Why did HP get rid of stack clear?
Message #7 Posted by Karl Schneider on 22 June 2004, 2:37 a.m.,
in response to message #6 by Garth Wilson

"CLST" was a useful command, I think, primarily in programming in order to ensure "causality" (same inputs, same algorithm, and same initial state ==> same outputs every time) in programs that might utilize stack operations while assuming an initially empty stack.

(Certainly, 0 ENTER ENTER ENTER in "interactive mode" is easier than executing CLST from the 42S CLEAR menu or XEQ "CLST". However, CLST is a cleaner program instruction.)

The reason CL_Sigma did a stack clear on the pre-Pioneer RPN HP's was to help prevent sabotaged calculations of standard deviations caused by debris data in the y-stack when subsequently entering stat data. These calc's automatically performed Y-variable summations using the y stack values, and always calculated SD for Y-variables as well, whether or not 2-variable statistics was being performed.

The 32S/32SII/33S, however, allows the user to calculate X-variable and Y-variable statistics separately. Thus, bogus Y-data that was inadvertently utilized cannot bollix the SD calculations. So, clearing the stack beforehand is not of utmost importance; and, there's no room for "CLST" unde the CLEAR menu, anyway...

Alles klar? Probably not... ;-)

            
Re: Why did HP get rid of stack clear?
Message #8 Posted by Ángel Martin on 22 June 2004, 3:50 a.m.,
in response to message #6 by Garth Wilson

A beautiful application of CLST is with the MMOVE function, to move matrix elements from one matrix to another. In such instance, CLST is the predifined boundary conditions for element selection.

Best, ÁM

      
Re: Why did HP get rid of stack clear?
Message #9 Posted by Chris Woodhouse on 22 June 2004, 11:21 a.m.,
in response to message #1 by Tom

WARNING: the opinions expressed below are those of a very opinionated poster. The readers may not agree with all or any of them, but they should ;)

Regardless of whether or not a 4 level stack HP RPN calculator has a Clear stack function, you can't ever "REALLY" clear the stack. All that you can and all that the function does is set every element to zero. Having zero in a register when you think something else is there is no worse than having any other value. Either way the calculation is going to be wrong. Your best solution when that happens is to use the last X function. It is an extremely bad idea for a program assumes there will always be zeros in the stack, if it does, it should to be re written. The only purpose a clear stack feature has is to give you that nice warm fuzzy feeling my calculus professor used to talk about :)

Chris W

            
Re: Why did HP get rid of stack clear?
Message #10 Posted by Veli-Pekka Nousiainen on 22 June 2004, 12:20 p.m.,
in response to message #9 by Chris Woodhouse

Yes, but if you accidentaly press another basic operation key you certainly get an interesting error:
Stack filled with zeroes, pressed operation one time more:
[ + ] nothing happens
[ - ] negative taken, [CHS] can correct this
[ * ] zero => LASTX
[ / ] zero => LASTX
[Y^x] zero => LASTX
BUT
if you have something else dropping down from the T-register, the wrong result may go unnoticed

Opinions? (VPN)

            
Re: Why did HP get rid of stack clear?
Message #11 Posted by Wayne Brown on 22 June 2004, 12:24 p.m.,
in response to message #9 by Chris Woodhouse

Quote:
Having zero in a register when you think something else is there is no worse than having any other value.

Actually, I think it's better to have zero rather than some other value in stack registers you don't plan to use. I'm going to quote myself here, from a previous message I posted in May on this subject:

"If you make a mistake (like hitting an operator key once too often) then having zeros in the stack levels immediately above your calculations can be useful. Some operations (like addition and subtraction) have no effect with zero, while others (like multiplication and division) give very obvious errors with zero. For instance, if I accidentally multiplied 4832564.23565 by 0.1 I might not notice the difference, but I certainly would notice if I multiplied it by 0. So I'd rather not have any non-zero numbers on the stack that aren't part of whatever I'm doing at the time."

      
Re: Why did HP get rid of stack clear?
Message #12 Posted by Fred on 25 June 2004, 6:19 p.m.,
in response to message #1 by Tom

What use is stack clear?

            
Re: Why did HP get rid of stack clear?
Message #13 Posted by Richard Garner on 26 June 2004, 11:15 a.m.,
in response to message #12 by Fred

It is very useful when you want to start running through calculation from a known state without having to do a master memory clear. I am not that much of a game person, but if you are running a game program that supports multi-players, a clear stack command is handy to keep others from seeing what you have just entered.

Playing Devil's Advocate here, what is the use of a clear register command? Couldn't you just go 0.0000 store 01, 0.0000 store 02, 0.0000 store 03 etc. in programs when you need to clear the registers.

I consider Clear Stack and Clear Registers to be very useful command and use them all the time, especially in programs when I need the calculator to be in a known state before proceeding.


[ Return to Index | Top of Index ]

Go back to the main exhibit hall