
Page 21-35
(Recall that the function SWAP is available by using
„°
@)STACK @SWAP@
).
Store the program back into FUNCa by using
„
@FUNCa
. Next, run the
program by pressing
@FUNCa
. Enter a value of 2 when prompted, and press
`
. The result is now two tagged numbers
a:2.
in stack level 2, and
F:11.
in stack level 1.
Note
: Because we use an input string to get the input data value, the local
variable
a
actually stores a tagged value (
:a:2
, in the example above).
Therefore, we do not need to tag it in the output. All what we need to do is
place an
a
before the SWAP function in the subprogram above, and the
tagged input is placed in the stack. It should be pointed out that, in
performing the calculation of the function, the tag of the tagged input a is
dropped automatically, and only its numerical value is used in the calculation.
To see the operation of the function FUNCa, step by step, you could use the
DBUG function as follows:
³
@FUNCa
`
Copies program name to stack level 1
„°LL
@)@RUN@ @@DBG@
Starts
debugger
@SST
↓
@
Step-by-step debugging, result: “Enter a:”
@SST
↓
@
Result:
{“
a:” {2 0} V}
@SST
↓
@
Result: user is prompted to enter value of a
2`
Enter a value of 2 for a. Result: “
:a:2”
@SST
↓
@
Result:
a:2
@SST
↓
@
Result:
empty
stack,
executing
→
a
@SST
↓
@
Result: empty stack, entering subprogram
«
@SST
↓
@
Result:
‘2*a^2+3’
@SST
↓
@
Result: empty stack, calculating
@SST
↓
@
Result:
11.,
@SST
↓
@
Result:
“F”
@SST
↓
@
Result:
F:
11.
@SST
↓
@
Result:
a:2.
@SST
↓
@
Result: swap levels 1 and 2
@SST
↓
@
leaving
subprogram
»
@SST
↓
@
leaving
main
program
»
Содержание 48GII
Страница 1: ...hp 48gII graphing calculator user s guide H Edition 4 HP part number F2226 90020 ...
Страница 162: ...Page 3 37 Define this function by any of the means presented above and check that g 3 3 g 1 0 g 1 0 g 3 9 ...
Страница 201: ...Page 5 30 LIN LNCOLLECT POWEREXPAND SIMPLIFY ...
Страница 381: ...Page 11 55 Function KER Function MKISOM ...
Страница 461: ...Page 13 26 In the right hand side figure above we are using the line editor to see the series expansion in detail ...
Страница 777: ...Page 26 8 ...
Страница 840: ...Page L 5 ...