New guy and programming problem
|
08-27-2017, 03:15 PM
(This post was last modified: 08-27-2017 03:40 PM by Dieter.)
Post: #2
|
|||
|
|||
RE: New guy and programming problem
(08-27-2017 06:18 AM)Skirmitch Wrote: LBL "PAR2" This program will not work correctly if you enter a value at the R1 resp. R2 prompt. If you do so, the previous content of that variable (the value displayed after "R1?" resp. "R2?") will be pushed to Y and the new value is in X. So this mixes up the stack contents and the calculation will go wrong. Some later calculators, e.g. the 35s, behave differently in this regard. Anyway, you can do it this way: Code: 01 LBL "PAR2" You can insert a STO "R1" between line 09 and 10 so that the result is stored as input for the next calculation. This way you can add further resistors in parallel without having to re-enter the last result. But you can also do it without this fancy prompting and named variables: Code: 01 LBL "PAR" Or even better since it also allows zero resistances: Code: 01 LBL "PAR" If you replace line 03 with RCL ST Y you can even see both the current result in X and the previous one in Y. ;-) Both versions work for as many resistors in parallel as you like: 100 [ENTER] 150 [XEQ]"PAR" => 60 200 [R/S] => 46,15 50 [R/S] => 24 Dieter |
|||
« Next Oldest | Next Newest »
|
User(s) browsing this thread: 1 Guest(s)