EasyManuals Logo

HP HP-28S User Manual

HP HP-28S
341 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 #227 background imageLoading...
Page #227 background image
The
clauses in
the
example
represent
simple numerical calculations,
but
you
can
include
any
sequence
of objects
and
commands.
In effect,
a clause
is
like a
subprogram
within
the
program.
If
you write a
sepa-
rate
program
that
contains
the
clause
and
store this
program
in a
variable, you
can
use
the
variable's
name
as
the
entire
clause. In this
case a simple-looking
structure
like
IF
A THEN B
ELSE
C
END
can
represent
a
complicated
decision process
with
two possible com-
plicated results,
depending
on
the
contents
of
A,
B,
and
C.
IF
...
THEN
...
ELSE
...
END
Using
the
terminology
just
defined,
the
evaluation of this
conditional
structure
can
be
described as follows:
The
IF
clause
is
evaluated
and
returns
a flag.
If
the
flag is true,
the
THEN clause is evaluated; if
the
flag
is
false,
the
ELSE clause
is
evaluated.
For
another
example
of
this structure, see "FIB2 (Fibonacci
Numbers,
Loop Version)"
on
page
248.
IFTE (If-Then-Else-End Function)
The
first example
in
this
chapter
can
be
written
in algebraic
syntax
by
using
the
function
IFTE:
I
IFTE(X;o'!0,SINOO/X,
1)
I
This
form
is
handy
for symbolic calculations.
If
you execute
the
pro-
gram-structure
version
while
X is
undefined,
this algebraic
form
is
the
result.
The
arguments
to IFTE
must
be
representable
in
algebraic
syn-
tax; to include RPN
commands
in
the
conditional, you
must
use
the
program-structure
form.
The
IFTE function is
used
in
"FIBl (Fibonacci
Numbers,
Recursive
Version)"
on
page
247.
226
26:
Program
Structures

Table of Contents

Other manuals for HP HP-28S

Questions and Answers:

Question and Answer IconNeed help?

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

HP HP-28S Specifications

General IconGeneral
BrandHP
ModelHP-28S
CategoryCalculator
LanguageEnglish

Related product manuals