
Page 21-41
values may be a tedious process. You could have the program itself attach
those units to the input and output values. We will illustrate these options by
modifying yet once more the program
@@@p@@@
, as follows.
Recall the contents of program
@@@p@@@
to the stack by using
‚
@@@p@@@
, and
modify them to look like this:
Note
: I’ve separated the program arbitrarily into several lines for easy
reading. This is not necessarily the way that the program shows up in the
calculator’s stack. The sequence of commands is correct, however. Also,
recall that the character
does not show in the stack, instead it produces a
new line.
«
“
Enter V,T,n [S.I.]:
“
{
“
:V:
:T:
:n:
“
{2 0} V }
INPUT OBJ
→
→
V T n
«
V
‘
1_m^3
’
*
T
‘
1_K
’
* n
‘
1_mol
’
*
→
V T n
«
V
“
V
”
→
TAG
→
STR
“
”
+
T
“
T
”
→
TAG
→
STR
“
”
+
n
“
n
”
→
TAG
→
STR
“
”
+
‘
(8.31451_J/(K*mol))*(n*T/V)
‘
EVAL
“
p
”
→
TAG
→
STR + + +
MSGBOX
»
»
»
This new version of the program includes an additional level of sub-
programming (i.e., a third level of program symbols
«
»
, and some steps
using lists, i.e.,
V
‘
1_m^3
’
*
{ } +
T
‘
1_K
’
*
+
n
‘
1_mol
’
*
+ EVAL
→
V T n
The
interpretation
of this piece
of code
is as follows. (We use input string
values of
:V:0.01
,
:T:300
, and
:n:0.8
):
1.
V
: The value of V, as a tagged input (e.g., V:0.01) is
placed in the stack.
2.
‘
1_m^3
’
:
The S.I. units corresponding to V are then placed in
stack level 1, the tagged input for V is moved to
stack level 2.
3. *
: By multiplying the contents of stack levels 1 and 2,
Содержание 49g+
Страница 1: ...hp 49g graphing calculator user s guide H Edition 4 HP part number F2228 90006 ...
Страница 197: ...Page 5 30 LIN LNCOLLECT POWEREXPAND SIMPLIFY ...
Страница 377: ...Page 11 55 Function KER Function MKISOM ...
Страница 457: ...Page 13 26 In the right hand side figure above we are using the line editor to see the series expansion in detail ...
Страница 775: ...Page 26 10 the location of the backup battery in the top compartment at the back of the calculator ...
Страница 838: ...Page L 5 ...