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 #51 background imageLoading...
Page #51 background image
RPL Programming 1-25
Using Summations Instead of Loops
For certain calculations that involve summations, you can use the Σ function instead of loops. You can use Σ
with stack syntax or with algebraic syntax. Σ automatically repeats the addition for the specified range of the
index variable — without using a loop structure.
Example: The following programs take an integer upper limit n from the stack, then find the summation. One
program uses a FOR … NEXT loop — the other uses Σ.
Program: Comments:
"!
8!3!KL:!
7LK!^!
^!DU!'!
=<T:
Initializes the summation and puts
the limits in place.
Loops through the calculation.
»
Program: Comments:
"!
#!G!
+\-^[3FGF^WH/+
Uses Σ to calculate the summation.
»
Example: The following program uses ΣLIST to calculate the summation of all elements of a vector or matrix.
The program takes from the stack an array or a name that evaluates to an array, and returns the summation.
Program: Comments:
"!
LS_#!
3!
'!
`E6D:!
#E6D:!
\E6D:
Finds the dimensions of the array and
leaves it in a list on level 1.
Adds 1 to the list. (If the array is a vector,
the list on level 1 has only one element.
ΠLIST will error if the list has fewer than
two elements.)
Multiplies all of the list elements together.
Converts the array elements into a list, and
sums them.
»
Using Flags
You can use flags to control calculator behavior and program execution. You can think of a flag as a switch that
is either on (set) or off (clear). You can test a flag's state within a conditional or loop structure to make a
j
2
j 1=
n

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