The Museum of HP Calculators

HP Forum Archive 21

[ Return to Index | Top of Index ]

[WP34s] Complex number display
Message #1 Posted by fhub on 5 Jan 2013, 7:49 a.m.

WOW, that's really the greatest new feature which I've seen implemented since a long time! :-)

Now if we could only have the same for input of complex numbers, i.e. switching the entry line to the top alpha display after pressing any [i] key ... ;-)

Many thanks for this great improvement,
Franz

      
Re: [WP34s] Complex number display
Message #2 Posted by Paul Dale on 5 Jan 2013, 7:59 a.m.,
in response to message #1 by fhub

It didn't take long for someone to notice :-) Thank Nigel Dowrick for the inspiration for this one, he provided a number of patches to the firmware and this is a slight modification of one.

There is still a rough edge to work out and (no doubt) some bugs still.

Unfortunately, we don't know how we'd implement this on input sensibly.

- Pauli

      
Re: [WP34s] Complex number display
Message #3 Posted by Walter B on 5 Jan 2013, 8:08 a.m.,
in response to message #1 by fhub

Quote:
Now if we could only have the same for input of complex numbers, i.e. switching the entry line to the top alpha display after pressing any [i] key ... ;-)
Why do you want to make simple things complicated?

d;-)

            
Re: [WP34s] Complex number display
Message #4 Posted by fhub on 5 Jan 2013, 8:16 a.m.,
in response to message #3 by Walter B

Quote:
Why do you want to make simple things complicated?
Well, I won't say that "Re [i] Im" is more complicated than "Im [ENTER] Re" - and it's definitely more 'natural'.

Franz

                  
Re: [WP34s] Complex number display
Message #5 Posted by Walter B on 5 Jan 2013, 9:22 a.m.,
in response to message #4 by fhub

Well, beyond the fact that complex numbers aren't natural at all (pun intended) it's just a matter of habitude. And since we haven't got a spare key left on the WP 34S, anything will become more complicated than a straightforward ENTER. So forget [i] for this model.

d:-)

                        
Re: [WP34s] Complex number display
Message #6 Posted by fhub on 5 Jan 2013, 9:36 a.m.,
in response to message #5 by Walter B

Quote:
complex numbers aren't natural at all
The same is true for irrational/real numbers, isn't it? ;-)
Quote:
And since we haven't got a spare key left on the WP 34S
We won't need an extra key for this, the existing [CPX] could be used.
If [CPX] is pressed during number input, then it could simply switch an internal state 'complex entry' and use the following digits/number as imaginary part (and maybe even display the previous real part temporarily in the alpha display).
And after the whole complex number is entered (i.e. when pressing any input-terminating key), it could just swap X and Y before executing the desired function.

You see, no so difficult at all, it's just a matter of 'desired or not?'.

Franz

                              
Re: [WP34s] Complex number display
Message #7 Posted by Walter B on 5 Jan 2013, 9:49 a.m.,
in response to message #6 by fhub

Your suggestion would break something (see p. 123). And - since you asked for this statement - I don't want that. Content?

d:-I

                                    
Re: [WP34s] Complex number display
Message #8 Posted by fhub on 5 Jan 2013, 10:07 a.m.,
in response to message #7 by Walter B

Quote:
Your suggestion would break something (see p. 123).
123? There's only the list of printing commands.
And even if it would break something - who says that everything is optimal as it is currently?
Quote:
And - since you asked for this statement - I don't want that. Content?
No, not content at all!
Who are you compared with the vast majority here which has already requested this feature long time ago? ;-)

Franz

Edited: 5 Jan 2013, 10:16 a.m.

                                          
Re: [WP34s] Complex number display
Message #9 Posted by Walter B on 5 Jan 2013, 11:24 a.m.,
in response to message #8 by fhub

Quote:
Who are you compared with the vast majority here which has already requested this feature long time ago?
Most easy: I'm one of the two developers from the very beginning. And I take pride of it. Make your own calculator and your vote will count more - regardless whether there's just one loud Austrian or even really some majority.

d;-)

                                                
Re: [WP34s] Complex number display
Message #10 Posted by fhub on 5 Jan 2013, 11:31 a.m.,
in response to message #9 by Walter B

Quote:
loud Austrian
Well, being neighboured to Germany and only 1/10 of your population, we Austrians must be loud to be heard. :-)

Franz

                              
Re: [WP34s] Complex number display
Message #11 Posted by Paul Dale on 5 Jan 2013, 7:58 p.m.,
in response to message #6 by fhub

Quote:
We won't need an extra key for this, the existing [CPX] could be used.
If [CPX] is pressed during number input, then it could simply switch an internal state 'complex entry' and use the following digits/number as imaginary part (and maybe even display the previous real part temporarily in the alpha display).

I agree that it wouldn't be overly difficult to implement. That isn't the point here.

This feature would break consistency pretty badly. I'm allowed to execute any function with a number in the input area -- with this change, I can no longer execute any complex function from the same position but all other functions are still available.

The only way I can see to bring consistency back would be to totally disallow function execution while a number is being entered and this will have far reaching ramifications with respect to stack lift, enter etc.

- Pauli

                                    
Re: [WP34s] Complex number display
Message #12 Posted by fhub on 6 Jan 2013, 5:28 a.m.,
in response to message #11 by Paul Dale

Quote:
This feature would break consistency pretty badly. I'm allowed to execute any function with a number in the input area -- with this change, I can no longer execute any complex function from the same position but all other functions are still available.
I don't see any inconsistency here, and here's why:
If you want to execute a complex function then you must have entered a 'full' complex number previously (i.e. entered the real and imaginary part). So when you've only entered the first (=real) part, pressing [CPX] makes no sense for calling any complex function - the only sensible usage would be switching to the input of the imaginary part.
This _first_ press of [CPX] while in input mode can then set any internal flag and just expect the imaginary part, while every _further_ pressing [CPX] would then be executing the desired function.
Quote:
The only way I can see to bring consistency back would be to totally disallow function execution while a number is being entered and this will have far reaching ramifications with respect to stack lift, enter etc.
Of course that would indeed be a very bad idea, but not necessary as I've explained above. Everything could be solved with just an additional internal status flag with the meaning '[CPX] pressed the first time while entering a number?'.

Franz

                                          
Re: [WP34s] Complex number display
Message #13 Posted by Paul Dale on 6 Jan 2013, 6:22 a.m.,
in response to message #12 by fhub

You haven't thought this suggestion through anything like enough.

  • Program mode doesn't know if numeric entry is in progress or not when CPX is pressed. In fact it cannot know, consider this sequence in a program:

            x=0?
            1
            CPX
    

    What should CPX do here? This means we'd have to store CPX as a separate command op-code and figure out on the fly what it should do. Currently, CPX isn't stored separately in program mode, it is merged into the relevant instructions. That would have to change so it became a prefix word -- something we've none of currently and no support for. You'd likely lose the c indicator for complex commands which would make understanding programs more difficult. In fact you'd have to lose it because of beautiful sequences like this:

            FC? 04
            CPX
            COS
    

  • CPX digit pair would become problematic. That CPX 3 I typed doesn't always enter 0 and 3 onto the stack anymore. It depends on what came before.

  • We'd need another annunicator to indicate the tri-state nature of the CPX key -- something completely new in the user interface and probably different enough to be considered an exception which is something we try really hard to avoid.

  • We'd also lose the current method of inputting complex numbers which is useful at times.

I'm sure some means can be found to address some of these and I'm sure there are other issues I've not considered which will pop up -- I haven't spent much time considering the ramifications.

I'm certainly not going to be implementing this until we've discussed the pros and cons at length and we reach a consensus. We being Marcus, Walter and myself. Input will be accepted from others as always, but the final decision and responsibility is ours.

- Pauli

                                                
Re: [WP34s] Complex number display
Message #14 Posted by fhub on 6 Jan 2013, 7:00 a.m.,
in response to message #13 by Paul Dale

Quote:
You haven't thought this suggestion through anything like enough.
Of course my idea was just a first thought - only you know what and where anything has to be done to make it work correctly.
Quote:
Program mode doesn't know if numeric entry is in progress or not when CPX is pressed. In fact it cannot know, consider this sequence in a program:
        x=0?
        1
        CPX
What should CPX do here?
I guess you mean 'entering a program' but not 'running a program' with 'program mode', correct?
Well, when entering a program there's no 'numeric entry mode' at all, each digit you enter is immediately stored as separate program step. So how should your sequence above be any problem?
Of course my idea for complex number input with "Re [CPX] Im" is only working in manual/calculator mode, not while entering a program - in a program a complex number has to be entered as it is currently.
So there's of course also no reason to make this CPX an extra op-code.
Quote:
CPX digit pair would become problematic. That CPX 3 I typed doesn't always enter 0 and 3 onto the stack anymore. It depends on what came before.
Despite of the fact that this CPX digit won't be used very often (at least IMO), it still would work exactly the way you already mentioned: it does depend on being in 'complex number input state' or not.
Quote:
We'd need another annunicator to indicate the tri-state nature of the CPX key -- something completely new in the user interface and probably different enough to be considered an exception which is something we try really hard to avoid.
Why tri-state?? CPX would use this indicator only when in input mode, and then only check if it has already been pressed or not (i.e. if it's the first time in which case it would just expect the imaginary part).
Edit: I've overlooked the 'annunciator' at the first read. Well, no extra annunciator needed - just push the previously entered real part to the alpha display when you press [CPX] to start the imaginary part entry.

But of course it's your decision, I just wanted to express my idea how such a (IMO more natural) complex number input could be realized.

Going in the background again, ;-)
Franz

Edited: 6 Jan 2013, 8:27 a.m. after one or more responses were posted

                                                      
Re: [WP34s] Complex number display
Message #15 Posted by fhub on 6 Jan 2013, 8:01 a.m.,
in response to message #14 by fhub

One further remark about this "tri-state nature of the CPX key -- something completely new in the user interface", which just came into my mind:

Isn't the decimal-point key [.] behaving exactly like this?
The first time you press [.] it enters a decimal point, but the next time (during the same input) it switches to 'fractional number input'.

I'd say quite similar to what I suggested for the CPX key ... ;-)

And about this:

Quote:
We'd also lose the current method of inputting complex numbers which is useful at times.
Well, a complex number could still be entered as "Re [ENTER] Im [X<>Y]".
Not very complicated. :-)

Franz

Edited: 6 Jan 2013, 8:10 a.m.

                                                            
Re: [WP34s] Complex number display
Message #16 Posted by Walter B on 6 Jan 2013, 10:12 a.m.,
in response to message #15 by fhub

Quote:
Well, a complex number could still be entered as "Re [ENTER] Im [X<>Y]".
Warum einfach, wenn's auch kompliziert geht.

d;-)

                                                      
Re: [WP34s] Complex number display
Message #17 Posted by Pete Wilson on 6 Jan 2013, 11:16 p.m.,
in response to message #14 by fhub

I would assume he meant when executing a program... How would tht be handled?

                                                            
Re: [WP34s] Complex number display
Message #18 Posted by fhub on 7 Jan 2013, 4:59 a.m.,
in response to message #17 by Pete Wilson

Quote:
I would assume he meant when executing a program... How would tht be handled?
His code part
        x=0?
        1
        CPX
can't be meant as program execution, because there's no CPX as stand-alone opcode.
My idea only affects the input of complex numbers but not the execution of any code.

Franz

      
Re: [WP34s] Complex number display
Message #19 Posted by Harald on 5 Jan 2013, 8:40 p.m.,
in response to message #1 by fhub

Did I miss something? Just updated to the latest firmware but didn't notice any changes.

            
Re: [WP34s] Complex number display
Message #20 Posted by Paul Dale on 5 Jan 2013, 9:29 p.m.,
in response to message #19 by Harald

Perform a complex operation. e.g. CPX +

You'll notice something then :-)

- Pauli

                  
Re: [WP34s] Complex number display
Message #21 Posted by Harald on 7 Jan 2013, 9:34 a.m.,
in response to message #20 by Paul Dale

I have just noticed there is a version 3339. For some reason I thought the 3335 was the latest. I'll give it a go when I get home.

                        
Re: [WP34s] Complex number display
Message #22 Posted by fhub on 7 Jan 2013, 9:43 a.m.,
in response to message #21 by Harald

Quote:
I have just noticed there is a version 3339. For some reason I thought the 3335 was the latest. I'll give it a go when I get home.
I guess you're still using the old SVN link, 3335 and 3339 are definitely outdated.

The new WP34s repository is at this link:
http://sourceforge.net/p/wp34s/code/

The version there is already at 3354, but I would recommend going back to 3350, because the real calc builds after 3350 have been compiled with a new compiler and seem to be buggy.

Franz

                              
Re: [WP34s] Complex number display
Message #23 Posted by Harald on 7 Jan 2013, 10:35 a.m.,
in response to message #22 by fhub

Oops, that is true. Completely forgot about the repository relocation. Thanks for pointing that out!

                                    
Re: [WP34s] Complex number display
Message #24 Posted by Marcus von Cube, Germany on 7 Jan 2013, 2:01 p.m.,
in response to message #23 by Harald

I've made an attempt at fixing the bugs.

                                    
Re: [WP34s] Complex number display
Message #25 Posted by Harald on 7 Jan 2013, 5:29 p.m.,
in response to message #23 by Harald

I flashed the calculator with the latest revision now and I like it. Very nice! So now that the display limitations are overcome, how about a "real" complex stack? Something like the 42s has. On the other hand, that is probably too much to ask, as this would probably turn everything on its head.

Cheers, Harald

                                          
Re: [WP34s] Complex number display
Message #26 Posted by Paul Dale on 7 Jan 2013, 5:39 p.m.,
in response to message #25 by Harald

The display limitations aren't overcome. It is possible to get down to 3 and perhaps even 2 mantissa digits showing.

- Pauli

                                          
Re: [WP34s] Complex number display
Message #27 Posted by Walter B on 7 Jan 2013, 7:22 p.m.,
in response to message #25 by Harald

Quote:
... how about a "real" complex stack? Something like the 42s has.
You won't get that with the WP 34S for various reasons, we're sorry. Please wait for the 43S.

d:-)

                  
Re: [WP34s] Complex number display
Message #28 Posted by Jeff O. on 7 Jan 2013, 3:56 p.m.,
in response to message #20 by Paul Dale

I like it, I think it is pretty close to a request that I made somewhere along the line. Glad to see it implemented. Is there or could there be a way to invoke this display mode at any time? (Temporarily, of course, exactly as if the displayed values were the result of a complex operation.) How about CPX SHOW (CPX - g - EXIT)?

Edited: 7 Jan 2013, 3:57 p.m.

                        
Re: [WP34s] Complex number display
Message #29 Posted by fhub on 7 Jan 2013, 4:42 p.m.,
in response to message #28 by Jeff O.

Quote:
How about CPX SHOW (CPX - g - EXIT)?
Won't even require the [g] prefix, because the EXIT key has no complex function.

But a simple [x<>y] would also display the imaginary part - ok, not in such a nice way. ;-)

Franz

                        
Re: [WP34s] Complex number display
Message #30 Posted by Paul Dale on 7 Jan 2013, 4:54 p.m.,
in response to message #28 by Jeff O.

I predicted this would be asked for :-)

We've not come up with a way to do this. At least nothing seems better than x<>y. It is going to be hard to beat two keystrokes (x<>y to see the complex component and x<>y again to restore the stack). With x<>y you also get a proper display according to the current display mode settings -- no truncation required.

- Pauli

Edited: 7 Jan 2013, 4:55 p.m.

                              
Re: [WP34s] Complex number display
Message #31 Posted by fhub on 7 Jan 2013, 5:01 p.m.,
in response to message #30 by Paul Dale

Quote:
We've not come up with a way to do this. At least nothing seems better than x<>y.
And what about displaying it immediately whenever the CPX key is pressed (and removing it again with any next key, also with a 2nd CPX)?
Any problems with this method?

Franz

                                    
Re: [WP34s] Complex number display
Message #32 Posted by Paul Dale on 7 Jan 2013, 5:36 p.m.,
in response to message #31 by fhub

This one was mooted and things get ugly once you start pressing shift keys after CPX.

- Pauli

                                          
Re: [WP34s] Complex number display
Message #33 Posted by fhub on 7 Jan 2013, 5:54 p.m.,
in response to message #32 by Paul Dale

Quote:
This one was mooted and things get ugly once you start pressing shift keys after CPX.
I don't understand, what's the problem?
As I said, every next key (i.e. also shift/prefix keys) should just remove the alpha display again - exactly the same happens with the currently implemented imaginary alpha display after a complex operation.

Franz

Edited: 7 Jan 2013, 6:05 p.m.

                                                
Re: [WP34s] Complex number display
Message #34 Posted by Walter B on 7 Jan 2013, 7:27 p.m.,
in response to message #33 by fhub

We won't do that. Period.

d:-)

                                                      
Re: [WP34s] Complex number display
Message #35 Posted by fhub on 8 Jan 2013, 4:54 a.m.,
in response to message #34 by Walter B

Quote:
We won't do that. Period.
Oh, a typical Walter's argumentation again - compelling and convincing as usual! ;-)

Franz

                                                            
Re: [WP34s] Complex number display
Message #36 Posted by Walter B on 8 Jan 2013, 5:13 a.m.,
in response to message #35 by fhub

Maybe, but it seems the only way you understand. Else you repeat and repeat ... ad nauseam. So it's kind of self-defense.

d:-/

                                                                  
Re: [WP34s] Complex number display
Message #37 Posted by fhub on 8 Jan 2013, 5:54 a.m.,
in response to message #36 by Walter B

Quote:
Maybe, but it seems the only way you understand. Else you repeat and repeat ... ad nauseam. So it's kind of self-defense.
Well, I did understand that you (or Pauli) don't want to implement it, I just wanted to understand why you won't do it. So your reply wasn't really helpful, at least not for me.

Of course "it is as it is, point!" is always the simplest answer - especially if you don't have a real reason, but it doesn't really increase the pleasure to actively participate in improving the WP34s project.

Franz

                                                                        
Re: [WP34s] Complex number display
Message #38 Posted by Paul Dale on 8 Jan 2013, 6:17 a.m.,
in response to message #37 by fhub

I said why.

- Pauli

                                                                              
Re: [WP34s] Complex number display
Message #39 Posted by fhub on 8 Jan 2013, 6:30 a.m.,
in response to message #38 by Paul Dale

Quote:
I said why.
All you said was "things get ugly once you start pressing shift keys after CPX", and that should be a satisfying answer???

I've explained that displaying "i..." in the alpha display after pressing CPX is exactly the same situation as displaying "i..." after any complex function (as it is in the current version). Pressing any key after this immediately removes the alpha display again - if this works (and it does work!) for complex results, then why shouldn't it work exactly the same way after just pressing the CPX key?
Sorry, but maybe I'm the only one who doesn't understand this ...

Franz

Edited: 8 Jan 2013, 7:57 a.m.

                                                                                    
Re: [WP34s] Complex number display
Message #40 Posted by Walter B on 8 Jan 2013, 8:07 a.m.,
in response to message #39 by fhub

Quote:
... maybe I'm the only one who doesn't understand this ...
Obviously.

d:-)

                                                                                          
Re: [WP34s] Complex number display
Message #41 Posted by fhub on 8 Jan 2013, 8:31 a.m.,
in response to message #40 by Walter B

Quote:
Obviously.
Ok, then an idiot like me is obviously in the wrong place here.

Cheers,
Franz

                              
Re: [WP34s] Complex number display
Message #42 Posted by Jeff O. on 7 Jan 2013, 9:21 p.m.,
in response to message #30 by Paul Dale

Quote:
I predicted this would be asked for :-)

Too bad you didn't bet on it :-)

I realize that the imaginary part can be viewed by x<>y followed by another, I was just looking for a way to get that nifty display back. CPX - CHS twice should do the job with no harm if I really feel the need.

                                    
Re: [WP34s] Complex number display
Message #43 Posted by Marcus von Cube, Germany on 8 Jan 2013, 1:57 a.m.,
in response to message #42 by Jeff O.

In a program you can do it "manually" with the alpha register but a cVIEW function could become handy to show progress in a program dealing with complex numbers.

                                          
Re: [WP34s] Complex number display
Message #44 Posted by Walter B on 8 Jan 2013, 3:53 a.m.,
in response to message #43 by Marcus von Cube, Germany

Something like cVIEW X ...

d:-)

                                          
Re: [WP34s] Complex number display
Message #45 Posted by Paul Dale on 8 Jan 2013, 6:21 a.m.,
in response to message #43 by Marcus von Cube, Germany

A cVIEW command with a register argument makes sense to me.

CPX h-shift VIEW . . is five keystrokes whereas x<>y twice is two so it isn't a win there but it could be useful in a program.

- Pauli

                                          
Re: [WP34s] Complex number display
Message #46 Posted by Jeff O. on 8 Jan 2013, 9:23 a.m.,
in response to message #43 by Marcus von Cube, Germany

Quote:
In a program you can do it "manually" with the alpha register...

I came up with the following long ago, but it does not handle display formatting as well as Pauli's new complex results display mode. Did you have something better in mind?

CLa
ai
aRC# Y
PROMPT

(“a” means “alpha”)

                                                
Re: [WP34s] Complex number display
Message #47 Posted by Walter B on 8 Jan 2013, 10:00 a.m.,
in response to message #46 by Jeff O.

I'd use VW[alpha]+ instead of PROMPT for obvious reasons.

d:-)

      
Re: [WP34s] Complex number display
Message #48 Posted by Paul Dale on 9 Jan 2013, 2:46 a.m.,
in response to message #1 by fhub

The latest subversion build has a new complex VIEW command. CPX h-shift VIEW. Let us know of any bugs or problems.

- Pauli

            
Re: [WP34s] Complex number display
Message #49 Posted by Jeff O. on 9 Jan 2013, 8:54 a.m.,
in response to message #48 by Paul Dale

Seems to work fine. Thanks. From the keyboard, it takes five keystrokes, as opposed to only four for CPX - x<>y - CPX - x<>y if I really feel the need to redisplay the x and y values as a complex number. But my program to do the job is now only three steps:

LBL 16
cVIEW X
RTN

Of course the command would also be useful to view higher stack levels without disturbing the stack, e.g. cVIEW A to take a look at the the complex value in the pseudo-Z level of the pseudo-complex stack.

...

                  
Re: [WP34s] Complex number display
Message #50 Posted by Walter B on 9 Jan 2013, 12:53 p.m.,
in response to message #49 by Jeff O.

Quote:
From the keyboard, it takes five keystrokes, as opposed to only four for CPX - x<>y - CPX - x<>y if I really feel the need to redisplay the x and y values as a complex number.
Almost ;-) Just x<>y x<>y is sufficient (i.e. two keystrokes). Please see p. 31 and notice the difference between x and xc.
Quote:
Of course the command would also be useful to view higher stack levels without disturbing the stack, e.g. cVIEW A to take a look at the the complex value in the pseudo-Z level of the pseudo-complex stack.
Yes. As designed now, cVIEW A will display zc in an 8-level stack.

d:-)

Edited: 9 Jan 2013, 12:54 p.m.

      
Re: [WP34s] Complex number display
Message #51 Posted by fhub on 12 Jan 2013, 7:46 a.m.,
in response to message #1 by fhub

I just saw that [CPX][Rv] and [CPX][R^] (also [CPX][ENTER] and [CPX][DROP]) don't show this new "i..." alpha display.
Since it works for [CPX][x<>y] and [CPX][+/-] it seems that it has been overlooked for those 4 operations!?

Franz

Edited: 12 Jan 2013, 8:00 a.m.

            
Re: [WP34s] Complex number display
Message #52 Posted by Walter B on 12 Jan 2013, 8:39 a.m.,
in response to message #51 by fhub

Quote:
I just saw that [CPX][Rv] and [CPX][R^] (also [CPX][ENTER] and [CPX][DROP]) don't show this new "i..." alpha display.
Since it works for [CPX][x<>y] and [CPX][+/-] it seems that it has been overlooked for those 4 operations!?
Thanks for reporting. I forwarded it to our SW department.

d:-)

            
Re: [WP34s] Complex number display
Message #53 Posted by Paul Dale on 12 Jan 2013, 6:18 p.m.,
in response to message #51 by fhub

These ones never set the complex operation flag -- so the bug has been there forever it is just more noticeable now. Also complex FILL.

Fixed now.

- Pauli


[ Return to Index | Top of Index ]

Go back to the main exhibit hall