EasyManua.ls Logo

HP HP-11C

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
Loading...
Section
11:
Programming
Techniques
207
leaving
the
details
out.
The
necessary
details
will
be
filled
in
later
as
programming
language,
space,
and
personal
preference
dictate.
For
now,
all
we
are
trying
to
accomplish
is
to
lay
down
the
foundations
of
the
solution.
In the
case
at
hand,
we
might
choose
to
solve
the
problem
using
the
quadratic
equation,
namely:
.
—b
+\/b%
—4ac
2a
With
this
equation
to
guide
us,
our
initial
algorithm
might
look
like
this:
Find
b2
4ac.
If
the
difference
is
positive,
find
—b
+\/b%
—4ac
2a
If
the
difference
is
negative,
find
——;b
and
£_|£2“_:_:4_ac_|
a
a
In
the
case
where
b?
4ac
is
positive,
the
solution
is
in
the
form
of
two
real
roots.
When
the
difference
is
negative,
the
solution
is
in
the
form
of
two
complex
numbers.
Note
that
none
of
the
above
statements
define
actual
program
steps.
What
is
defined
is
the
sequence
of
events
required
to
arrive
at
the
solution.
Refinement
of
the
basic
algorithm
will
bring
out
repeating
patterns
and
condensable
sequences
that
suggest
the
actual
program
steps
that
will
ultimately
be
used.
The
revision
process
will
also
help
to
keep
your
programming
objectives
in
mind.
One
such
refinement
might
be:
Using
the
hypothetical
registers
R
4,
R
g,
and
R
do
the
following:
1.
Takethe
negative
of b
and
divide
it
by
twice
a.
2.
StorethisresultinR
4.
3.
Square
b,
subtract
four
a times
¢
from
it
and
store
the
result
in
R
B-
4.
Take
the
square
root
of
the
absolute
value
of
Rg
and
divide
it
by
twice
a.

Table of Contents

Related product manuals