Intel fortran-80 Laptop User Manual


 
FORTRAN-SO
f'ORTRAN
Concepts
Relational expressions
are
commonly
used in
the
IF
statement
(Chapter
4).
IF (NUMB .GT.
99)
STOP
IF
(PNAME .EO. 'GEHRIG') PRINT 20, PNAME, AVG
2.2.4.3.2
Interpretation
of
Arithmetic
Relational Expressions.
An
arithmetic
rela-
tional
expression
is
TRUE
if
the values
of
the
operands
satisfy the relational condi-
tion
set
up
by
the
operator,
and
is
FALSE
otherwise.
If
the
operands
are
of
different
types, type conversion
is
similar
to
that
of
arithmetic
expressions.
The
relational expression
EXP1
operator
EXP2
is evaluated as
if
it were written
(EXP1
- EXP2)
operator
0
where
'0'
is the same type as
(EXPI
-
EXP2)
and
'operator'
is the same relational
operator
in
both
expressions.
2.2.4.3.3
Interpretation
of
Character
Relational Expressions. A
character
rela-
tional expression
is
TRUE
if
the values
of
the
operands
satisfy the relational condi-
tion
set
up
by the
operator,
and
is
FALSE
otherwise.
If
two
character
operands
have
different
lengths, the
shorter
is
'extended'
to
the
length
of
the
longer by
adding
blanks
on
the right
of
the
character
string.
The
character
expression
EXP
1
is
considered
to
be less
than
EXP2
if
the value
of
EXP
1
precedes
the
value
of
EXP2
in
the
ASCII
collating sequence,
and
vice versa (Appen-
dix E).
2.2.4.4 Logical Expressions. A logical expression
performs
a logical
computa-
tion
and
returns
a
TRUE
or
FALSE
result
of
type logical. This expression can be a
single logical
operand
(logical
constant,
logical variable reference, logical
array
ele-
ment
reference, logical
function
reference,
or
relational expression)
or
a
combina-
tion
of
logical
operands
joined
by logical
operators
and
parentheses.
2.2.4.4.1
Logical
Operators.
The
logical
operators
are:
Operator
.NOT.
.AND.
.OR.
.EQV.
.NEQV.
Meaning
Logical
negation
Logical
conjunction
Logical inclusive
disjunction
Logical equivalence
Logical nonequivalence
2.2.4.4.2
Value
and
Length
of
Logical Expressions.
The
value
of
a logical
operand
involving
.NOT.
is
as follows:
OP1
.NOT.OP1
TRUE
FALSE
FALSE TRUE
The
logical expression has
the
opposite
value as its
operand.
2-9