HP42S' "practical challenge + stuff"... Message #2 Posted by Vieira, Luiz C. (Brazil) on 20 Jan 2003, 10:44 a.m., in response to message #1 by Karl Schneider
Hi;
About one year before receiving my "diploma" (certificate) as an Electrical Engineer I wrote a program to compute Load Flow running in an HP42S (good old times...). The complex manipulation was extensive and the program dealt with complex numbers a lot. I remember that I had to assemble and disassemble complex numbers many times, and once I thought: "It's not possible to enter four different complex numbers in the HP42S stack as we can do in the HP15C". I tried a few times, but the needing to finish the program was a priority and I do not remember thinking of this again. I still believe it's not possible UNLESS we use a temporary variable OR Lregister, that will not keep previous value. The mentioned procedure in the HP15C with CLX and Re<>IM does not change LSTx contents
The other lack in the HP42S is for the RE<>IM, not available. I used this routine: CPX?
COMPLEX
X<>Y
COMPLEX
The CPX? tests if a complex is already in the XRegister. If so, dismantle it. This way, Y and X will contain real and imaginary parts. Swap them (X<>Y) and reassemble the complex number (COMPLEX), now with Real and Imaginary parts swapped. This also cause previous Tvalue loss, what does not happen in the HP15C. I think that as we have plenty of bytes in the HP42S in relation to the HP15C, there's always space enough to create a single variable and save one stack register... But I'd like to have a twobyte [Re<>Im] in the HP42S instead of the sevenbytes sequence above.
Another weird thing: since the first RPNbased calculators, the "natural" 2numbers input sequence has always been Yvalue ENTER Xvalue [function]. This applies mostly to rectangulartopolar conversion and its counterpart, and twonumber statistics. Even in some original HP applications, this sequence is disregarded and we see Xvalue ENTER Yvalue [routine]. I'm trying to figure out why did HP implemented the realtocomplex conversion in both HP15C and HP42S with a "reversedinput" sequence? The HP28 and the HP48 series is somewhat different, if we consider operator [>] , that acts uniformly as an operator, so [>V2] and «> a b « procedure »» will cause values in in the stack to be used toptodown , say,
level2 contents to X (real part of V) or 'a' and level1 contents to Y (imaginary part of V) or 'b'.
I do not complain as it is an uniform relation.
But in both HP15C and HP42S we must think that, if we are working with real numbers, we must enter Y then X prior to compute its polar representation, what agrees with RPN "principles" and stackregisters' names. Otherwise, I have to enter X then Y to build (X+iY) number, disagreeing the same principle. It happens the same with polar representation.
Wow! Too much words for a notsocomplicated matter. My daughter says "You were born to be a teacher, indeed!" everytime she asks me a question and I take many minutes of her attention to answer. And she is 11 Y.O....
Cheers.
