Description
In
order to perform operations in RPN mode, the object or objects must be
placed on the stack. Entries on the stack are numbered and each entry on
the stack has an associated level (the number of the line on which the
entry appears). This document discusses placing, entering, and
retrieving objects on the stack. This document also gives examples of
stack calculations.
NOTE:
To use the stack, the calculator must be in RPN mode. To activate the
RPN mode, press MODE to access the CALCULATOR MODES input form, and set
the mode option to RPN.
Calculator symbol key
The procedures in this document use the following text to represent symbol keys:
Placing objects on the stack
New
objects can be created and placed on the stack or objects can be
retrieved from the calculator's memory and placed on the stack.
Entering a number on the stack
To enter a number on the stack, do the following:
- Use the NUMERIC keys to enter the number.
- Press ENTER (the number will appear on level 1 of the stack).
Entering an object that was created in an application, such as a matrix or an equation
To enter an object that was created in an application, such as a matrix or an equation, do the following:
- Access the MATRIX WRITER or EQUATION WRITER.
- Create the matrix or equation.
- Press ENTER to place the matrix or equation on level 1 of the stack.
Retrieving an object from memory and placing it on the stack
To retrieve an object from memory and place it on the stack, do the following:
- Press VAR to display the directories and variables in the current directory.
- Navigate to the directory that holds the desired object.
- Press the appropriate function key to select the object.NOTE: When a new item is added to the stack, the existing items are pushed up a level. That is, the item at level 1 is pushed up to level 2, and the item at level 2 is pushed up to level 3, and so on.
Example of stack calculations
One-argument commands
To use a one-argument command, do the following:
- If the argument is not already on level 1 of the stack, enter the argument onto the command line (and, optionally, onto the stack). If the argument is already on level 1 of the stack, go directly to Step 2.
- Execute the command by pressing ENTER.
Example of using a one argument command
To calculate 1/sin 30, do the following:
- Enter 30, then press ENTER.
- Press SIN. (The result of sin 30 is now on level 1 of the stack. This result can be used as the argument of a further command without having to re-enter the result.)
- Press 1/x.NOTE: If the answer is symbolic when a numeric answer was wanted, press LS+NUM.
Using multi-argument commands
Method 1
To use method 1 in using multi-argument commands, do the following:
- Enter the arguments, pressing ENTER after each one.
- Execute the command.
Method 1 example of executing multi-argument commands
To calculate 23 x 97, do the following:
- Enter 23 and press ENTER.
- Enter 97 and press ENTER (23 is now on level 2 of the stack and 97 is on level 1).
- Press x.
In
this example, the order in which the arguments are entered does not
affect the answer. However, this is not always the case with
two-argument commands. For example, 52 raised to the power of 3 is
different from 3 raised to the power of 52. Therefore, 52 must be
entered before 3 in order to get the correct answer. Other examples
where the order in which the arguments are entered affects the answer
include the following:
- Subtraction
- Division
- Percentage commands (%, %CH, and %T)
Method 2
In
method 1, each argument is entered onto its own level of the stack
before the command is executed. Another way is to enter all of the
elements onto the command line separating each with a space. You can
then do either of the following:
- Press ENTER to place the arguments onto the stack and then execute the command.
- Execute the command with the arguments still on the command line.
Method 2 example of using multi-argument commands
To calculate the cube root of 531441, do the following:
- Enter 531441, SPC, then 3
- Press ENTER
- Press LS, then XROOT
Multi-command calculations
Because
the result of a calculation is retained on the stack, complex
calculations can be easily performed by accumulating the results of
sub-calculations on the stack and then treating the results as the
arguments in further calculations.
Example of multi-command calculations
To calculate 132 -(17 x 19) + 3/7, do the following:
- Enter 132, LS, then x (the result, 169, appears on level 1 of the stack).
- Enter 17 and press ENTER
- Enter 19 and press ENTER
- Press x (the product of 17 and 19, which is 323, appears on level 1 of the stack, and the previous result, 169, appears on level 2).
- Press [ - ]
- Press 3, ENTER, 7, then divide to place the result of 3/7 on level 1 of the stack.
- Press + to add this to the previous result.NOTE: If the calculator is in exact mode, the result appears as a number and a fraction. To display the approximate answer to 12-digit accuracy, press LS+NUM.
Example of using computer algebra commands
To substitute x=y + 3 in x2+ 3x +7, do the following:
- Use the EQUATION WRITER to create2x + 3x + 7 and press ENTER to place it on level 1 of the stack.
- Use the EQUATION WRITER to create the substitution x=y+3, and press ENTER.
- Press LS, then ALG to access the ALGEBRA COMMAND menu and select the SUBST command. The HP 49g performs the substitution and the result appears on level 1 of the stack.