Reference Guide

1-30 RPL Programming
Program: Comments:
«
→ a b
Creates local variables a and b.
'π^2*(b^2-a^2)'
Calculates the surface area.
→NUM
Converts algebraic to a number.
»
`
O
TORSA
K
Puts the program on the stack.
Stores the program in TORSA.
Here is a stack diagram and program listing for TORSV.
Level 2 Level 1
Level 1
a b
volume
Program: Comments:
«
→ a b
Creates local variables a and b.
«
Starts a program as the defining
procedure.
a b TORSA
Puts the numbers stored in a and b
on the stack, then calls TORSA
with those arguments.
b a - * 4 /
Completes the volume calculation
using the surface area.
»
Ends the defining procedure.
»
`
O
TORSV
K
Puts the program on the stack.
Stores the program in TORSV.
Now use TORSV to calculate the volume of a torus of inner radius a = 6 and outer radius b = 8.
6
`
8
J
%TORSV%