Logical Comparisons And Lnequalities - Sharp PC-1500 Instruction Manual

Hide thumbs Also See for PC-1500:
Table of Contents

Advertisement

All
and
more
about Sharp
PC-1500
at
http://www.PC-1500.info
Input
Display
(
( 6
-
4)
I
21
* ( ( (
3 -
1l/
4)
*6)
f
EHTEstl
3
The equations
' 1
,Vi
thin
the
innermost
set
of
parentheses will
ah'Y'ays be calculated first
.
R
EMEMBER:
When
in
doubt.
use
parentheses to clari
fy
the
o
rder of
your
arithmetic
operations.
G. LOGICAL COMPARISONS AND INEQUALITIES
SHARP If.Jill
an-0
..
~1
you
to
cornparc
t ..
-.io
values
o
r
equat ions
and .,,..,ill
indicate to
you
the
result
of
the
cornparison.
This
ability is
basic to
designing
programs
which make decisions.
T
he
manner
in
\vh ich
this
is
do11e
,_.,ill
be
recognizable
t
o
students
of
the "New
Math" as
an inequal
ity
(don't
despair
if
you
~·,.1c
rcn
'
t
raised
on Nei.-v Math; the
au
thor \' > "asn't
either).
An
inequality
may be
thought
o
f
as
a
com
parison w
hich
is
ei
ther
t
n.re or
false.
For instance,
the
statement
"six
divided
by
th ree is
equal
to
l\vo"
is
a
cornpa
rison ..
'lh
ich
happens
t
o be
t
ru
e.
On the other
hand
.
the
statement,
"six divided by
t
h
ree is
greate
r
than f
ive"
is a
false
comparison.
Computers a nd mathematicians u
se
the
fol
lowing
symbols for the possible
types
o
f
corn·
par isons:
<
less
than
>
greate
r
than
~
equal
to
<
=
less
than
OR
e(1ual
to
>
=
greate
r
t
han
0 R
equal
to
<
>
not
equal
to
Thu
s, we
can
restate the
above
inequalities
symbol ically,
as:
6
I
3
=
2
and
6
I
3
>
5 respec·
t
ively.
Given
an inequalit
y, Sl-IA RP ..
viii
determ
ine v1hethcr
the
comparison
is
t rue
o
r
false
.
In
keep
ing
w
ith
current
computer
design
pract
ice. SHARP
w
ill
indicate a t rue
staternent
\vith
a
1
and
a
fa
l$e
11a1eme111 w
ilh
a
0.
For example if you
type
:
6
/
3
=
2
SHA
RP
w
ill
rc-spond
\vith
a
1
t
for
true).
T
ypin
g
the sequence:
6
/
3
>
5
w ill
elicit
a
response
of
0 (for
false).
T
ry
the
following
tests
of SHARP's
judgment
(be
sure
you a
re in
RUN
model
:
18
Do not sale this PDF
!!!

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents