HP F2226A - 48GII Graphic Calculator User Manual page 703

Graphing calculator
Table of Contents

Advertisement

Within the BRCH menu („°@) @ BRCH@) the following keystrokes are available
to generate START constructs (the symbol indicates cursor position):
„ @START
NEXT
‚ @START
The START...NEXT construct
The general form of this statement is:
start_value end_value START program_statements NEXT
Because for this case the increment is 1, in order for the loop to end you
should ensure that start_value < end_value. Otherwise you will
produce what is called an infinite (never-ending) loop.
Example – calculating of the summation S defined above
The START...NEXT construct contains an index whose value is inaccessible to
the user. Since for the calculation of the sum the index itself (k, in this case) is
needed, we must create our own index, k, that we will increment within the
loop each time the loop is executed. A possible implementation for the
calculation of S is the program:
0. DUP → n S k
«
«
NEXT S "S" →TAG » »
Type the program in, and save it in a variable called @@@S1@@@.
Here is a brief explanation of how the program works:
1. This program needs an integer number as input. Thus, before execution,
that number (n) is in stack level 1. The program is then executed.
„°@) @ BRCH@ @) S TART @START
: Starts the START...NEXT construct: START
: Starts the START...STEP construct: START
0. n START k SQ S + 1. 'k' STO+ 'S' STO
STEP
Page 21-54

Advertisement

Table of Contents
loading

This manual is also suitable for:

48gii

Table of Contents