HP Forums
(42S) Four level stack complex numbers entry. - Printable Version

+- HP Forums (https://www.hpmuseum.org/forum)
+-- Forum: HP Software Libraries (/forum-10.html)
+--- Forum: General Software Library (/forum-13.html)
+--- Thread: (42S) Four level stack complex numbers entry. (/thread-11881.html)



(42S) Four level stack complex numbers entry. - morex - 11-30-2018 05:04 PM

Four Level stack complex numbers entry.
by Guillermo Castarés
Nov-2018

The "COMPLEX" function provided in 42S to input complex numbers takes two parameters from stack. This leaves only 3 level stack for complex operations.

This little Program help to operate with complex numbers conserving a 4 level stack.

And if you assign the labels to custom menu you can save some keystrokes also.

Example of use:

[RECT]
3 [CpxA] 4 [CpxB]
1 [CpxA] 5 [CpxB]
[POLAR]
5 [CpxA] 45 [CpxB]
4 [CpxA] 30 [CpxB]
[RECT]
[+]
[*]
[+]

-17.6780 i44.5337


The same, other way:
[RECT]
3 [CpxA] 4 [R/S]
1 [R/S] 5 [R/S]
[POLAR]
5 [R/S] 45 [R/S]
4 [R/S] 30 [R/S]
[RECT]
[+]
[*]
[+]

-17.6780 i44.5337

Code:

00 { 71-Byte Prgm }
01>LBL "CpxA"          ;  Enter Re (RECT) or z (POLAR) 
02 STO "C,A"        
03 CLA
04 ARCL ST X
05 FC? 73
06 |-" i"
07 FS? 73
08 |-" \angle"
11 Rv
09 PROMPT               ; You can use R/S to confirm second entry
13>LBL "CpxB"          ; Enter Im (RECT) or angle (POLAR) 
14 R^
15 STO "C,T"
16 Rv
17 RCL "C,A"
18 X<>Y
19 COMPLEX
20 RCL "C,T"
21 Rv
22 CLV "C,A"
23 CLV "C,T"
24 END



RE: (42S) Four level stack complex numbers entry. - Luigi Vampa - 11-30-2018 05:37 PM

Gracias Guillermo por compartirlo / Thanks for sharing.