EasyManuals Logo
Home>HP>Calculator>15c Collector's Edition

HP 15c Collector's Edition User Manual

HP 15c Collector's Edition
308 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 #114 background imageLoading...
Page #114 background image
102 Section 9: Subroutines
Subroutine Limits
A subroutine can call up another subroutine, and that subroutine can call
up yet another subroutine. This “subroutine nesting”—the execution of a
subroutine within a subroutine—is limited to stack of subroutines seven
levels deep (this does not count the main program level). The operation
of nested subroutines is as shown below:
Main Program
b
A
b
1
b
2
b
3
b
4
G
1
G
3
G
2
G
4
n
n
n
n
n
End
Examples
Example: Write a program to calculate the
slope of the secant line joining points
(x
1
, y
1
) and (x
2
, y
2
) on the graph shown,
where y = x
2
− sin x (given x in radians).
The secant slope is:
y
2
y
1
x
2
x
1

or
x
2
2
sin x
2
x
1
2
sin x
1
x
2
x
1
The solution requires that the equation for y be evaluated twice—once
for y
1
and once for y
2
, given the data input for x
1
and x
2
. Since the same
calculation must be made for different values, it will save program space
to call a subroutine to calculate y.
The following program assumes that x
1
has been entered into the Y-
register and x
2
into the X-register.

Table of Contents

Questions and Answers:

Question and Answer IconNeed help?

Do you have a question about the HP 15c Collector's Edition and is the answer not in the manual?

HP 15c Collector's Edition Specifications

General IconGeneral
BrandHP
Model15c Collector's Edition
CategoryCalculator
LanguageEnglish

Related product manuals