Re: HP-15C: Library of complex-number utilities Message #6 Posted by Karl Schneider on 15 May 2008, 2:30 p.m., in response to message #5 by Rodger Rosenbaum
Roger, Marcus --
Yes, you're both right. Only tests for equality and inequality are meaningful for full complex values; working from memory, I simply forgot about those comparisons with y.
My point was the attention to detail in the functional specification for how the conditional tests work with flag 8 set. The most-sensible and useful functionality -- if not the most consistent -- was provided: "Use the full complex number if possible for a meaningful test; else, use only the real part."
Consider what HP could have done for the HP-15C:
-- No conditional-test functionality in complex mode because not all tests were defined;
-- The same functionality as for reals, blithely ignoring the imaginary parts for the equality and inequality tests;
-- Unorthodox tests, such as comparing the magnitudes of complex numbers, or requiring that both components meet the test for a result of "true".
No -- they thought it through, as they did for everything else.
The HP-42S does it differently: None of the conditional tests for zero are defined for complex-number input, but equality and inequality tests are defined for comparing two input complex numbers. Of course, the HP-42S' paradigm is different, as complex values can be placed in the stack, instead of having the imaginary-valued components in a separate stack. Complex numbers can be easily disassembled to execute the kind of test desired.
The HP-35s? "INVALID DATA" across the board for any conditional test using complex-valued input. And the user can't easily deconstruct or extract parts of a complex number...
Here's another subtle but important feature of the HP-15C: With flag 8 set, when entering a new value into the x-register immediately following ENTER (stack lift is disabled), the imaginary part of the number is changed to 0. Thus,
3 ENTER 4 I 3 ENTER 4 I
5 ENTER
* 5
*
will each give the correct answer of 15+j20 (even though ENTER is unnecessary), and will work the same way as in real mode, as do the following:
3 3 ENTER 4 I
ENTER ENTER
* *
Each gives the respective x2 answers of 9 and -7+j24.
When stack lift is disabled as a result of CLx, the imaginary part is not changed when a new value is entered.
Plenty of potential pitfalls were adroitly avoided when the pioneering full complex-number support for this paradigm of calculator was developed. HP nailed it, and I'm sure that some systematic methodology -- used by skilled and knowledgable developers -- is significantly responsible for that.
-- KS
Edited: 16 May 2008, 2:18 a.m.
|