EasyManuals Logo

HP HP-11C User Manual

HP HP-11C
264 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 #123 background imageLoading...
Page #123 background image
Section
8:
Subroutines
121
The
calculator
can
return
back
to
the
main
program
from
subroutines
that
are
nested
four
deep,
as
shown.
If
you
attempt
to
call
a subroutine
that
is
nested
five
levels
deep,
the
calculator
will
halt
and
display
Error
5
when
it
encounters
the
instruction
calling
the
fifth
subroutine
level.
Note:
While
any
one
set
of
nested
subroutines
can
be
up
to
four
levels
deep, there
is
no
limit
to
the
number
of
nested
subroutine
sets
or
non-nested
subroutines
you
can
include
in
a
program.
Subroutine
Usage
Example.
Write
a
program
for
cal-
culating
the
average
slope
between
x;
and
x5
on
the
graph
shown,
where
y=x?—sinx.
X1
X2
Solution:
The
average
slope
is
given
by
the
formula
yo—y1
_
(x°
—sinxy)
—(x2
—sinx))
X9
X4
X9
X1
Notice
that
the
solution requires
two
computations
of
the
expression
x2
sin
x
(once
for
x
=
x;
and
again
for
x
=
x,).
Since
the
solution
includes
an
expression
that
must
be
repeated
for
both
values
of
x,
we
can
create
a
subroutine
to
execute
the
repetition
and
save
space
in
program memory.

Table of Contents

Questions and Answers:

Question and Answer IconNeed help?

Do you have a question about the HP HP-11C and is the answer not in the manual?

HP HP-11C Specifications

General IconGeneral
BrandHP
ModelHP-11C
CategoryCalculator
LanguageEnglish

Related product manuals