EasyManuals Logo
Home>HP>Calculator>48GII

HP 48GII User Manual

HP 48GII
653 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Page #106 background imageLoading...
Page #106 background image
2-28 RPL Programming Examples
Techniques used in "RPN
! Recursion. The "RPN program calls itself as a subroutine. This powerful technique works just like calling
another subroutine as long as the stack contains the proper arguments before the program calls itself. In this
case the level 1 argument is tested first to be sure that it is an algebraic expression before "RPN is called
again.
! Object Type-Checking. "RPN uses conditional branching that depends on the object type of the level 1
object.
! Nested program Structures. "RPN nests IF…THEN…END structures inside FOR…NEXT loops inside a
IF…THEN… ELSE…END structure.
! List Concatenation. The result list of objects in RPN order is built by using the ability of the + command to
sequentially append additional elements to a list. This is a handy technique for gathering results from a
looping procedure.
"RPN program listing
Program: Comments:
"!
LS_#!
67!LN<K!
:;<=!#!G!*!
Take the expression apart.
If the argument count is nonzero,
then store the count and the
function.
"!
Begins local variable defining
procedure.
3!G!
7LK!t!
Begins FOR…NEXT loop, which
converts any algebraic arguments to
lists.
67!452!:P2<!Xd!DBM<
Tests whether argument is an
algebraic.
:;<=!#K2=!
If argument is an algebraic, convert
it to a list first.
<=4!G!KLEE4!
Roll down the stack to prepare for
the next argument.
=<T:!
Repeat the loop for the next
argument.
67!452!:P2<!Qd!C!
Tests to see if level 1 object is a list.
:;<=!3!#E6D:!
If not a list, then convert it to one.
<=4!
Ends the IF…THEN…END
structure.
67!G!3!9!
Tests to see if there is more than
one argument.
:;<=!H!G!
D:BK:!'!
=<T:!
Combine all of the arguments into a
list.

Table of Contents

Other manuals for HP 48GII

Questions and Answers:

Question and Answer IconNeed help?

Do you have a question about the HP 48GII and is the answer not in the manual?

HP 48GII Specifications

General IconGeneral
Battery typeCR2032
TypeScientific
Form factorPocket
Weight and Dimensions IconWeight and Dimensions
Weight220 g
Dimensions (WxDxH)184 x 87 x 23.5 mm

Related product manuals