EasyManua.ls Logo

HP HP-67 - Page 193

HP HP-67
364 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
Loading...
Branching
189
To
run
the
program
to
compute
taxes
on
incomes
of
$15,000
and
$7,500:
Slide
the
W/PRGM-RUN
switch
werem
Ji[[Irun
to
RUN.
Press
Display
15000
B3
Dollars
of
tax.
7500
3
Dollars
of
tax.
Another
place
where
you
often
want
a
program
to
make
a
decision
is
within
a
loop.
The
loops
that
you
have
seen
have
to
this
point
been
infinite
loops—that
is,
once
the
calculator
begins
executing
a loop,
it
remains
locked
in
that
loop,
executing
the
same
set
of
instructions
over
and
over
again,
forever
(or,
more
practically,
until
the
calculator
overflows
or
you
halt
the
running
program
by
pressing
or
any
other
key).
You
can
use
the
decision-making
power
of
the
conditional
instructions
to
shift
program
execution
out
of a
loop.
A
conditional
instruction
can
shift
execution
out
of
a
loop
after
a
specified
number
of
iterations
or
when
a
certain
value
has
been
reached
within
the
loop.
Example:
As
you
know,
your
HP-67
contains
a
value
for
e,
the
base
of
natural
logarithms.
(You
can
display
the
calculator’s
value
for e
by
pressing
1
B}
(€9).)
The
following
program
uses
the
series
e
=
1/0!
+
11!
+
1/2!
+
...
+
1/n!to
approximate
the
value
fore.
After
each
iteration
through
the
loop,
the
latest
approximation
is
displayed
and
compared
to
the
calculator’s
value
for
e.
When
the
two
values
are
equal,
the
execution
is
transferred
out
of
the
loop
to
stop
the
program.

Table of Contents

Other manuals for HP HP-67

Related product manuals