# Global And Local Variables And Subprograms - HP 48gII User Manual

Graphing calculator.

„´@) H YP @SINH
#~„x „º
1
/
~„x™
[']
„°@) @ MEM@@ @) @ DIR@@ @PURGE
`
_______________________
To save the program use:
Press J to recover your variable menu, and evaluate g(3.5) by entering the
value of the argument in level 1 (3.5`) and then pressing @@@g@@@.
The result is 1.2485..., i.e., g(3.5) = 1.2485. Try also obtaining g({1 2 3}),
by
entering
the
„ä1#2#3` and pressing @@@g@@@.
{SINH(1)/2 SINH(2)/5 SINH(3)/10}, if your CAS is set to
your CAS is set to APPROXIMATE mode, the result will be {0.5876..
0.7253... 1.0017...}.

## Global and local variables and subprograms

The program @@@g@@@, defined above, can be displayed as
«
'x' STO x SINH 1 x SQ ADD / 'x' PURGE
by using ‚@@@g@@@.
Notice that the program uses the variable name x to store the value placed in
level 1 of stack through the programming steps
while the program is executing, is stored in your variable menu as any other
program purges (erases) the variable x so it will not show in your variable
menu after finishing evaluating the program. If we were not to purge the
variable x within the program its value would be available to us after program
execution. For that reason, the variable x, as used in this program, is referred
to as a global variable. One implication of the use of x as a global variable
is that, if we had a previously defined a variable with the name x, its value
SINH
1 x SQ
/
'x'
PURGE
__________
[']~„gK
list
in
level
After calculating the function, the
Calculate sinh of level 1
2
Enter 1 and calculate x
2
Calculate (1+x
),
then divide
Purge variable x
Program in level 1
_____________________
1
of
the
display:
The result now is
EXACT
mode. If
"
'x' STO
. The variable x,
Page 21-2