Next: Operator Precedence
Up: Expressions and Assignment
Previous: Relational Operators
A LOGICAL or boolean expression returns a .TRUE. / .FALSE. result. The
following are valid with LOGICAL operands,
- .NOT. -- monadic `negation'. .TRUE. if operand
is .FALSE., for example, .NOT.(a .LT. b),
- .AND. -- logical `and'. .TRUE. if both operands are .TRUE.;
- .OR. -- logical `or'. .TRUE. if at least one operand is
.TRUE.;
- .EQV. -- equivalence. .TRUE. if operands are the same;
- .NEQV. -- non-equivalence.. .TRUE. if operands are different.
for example,
REAL :: a, b, x, y
LOGICAL :: l1, l2
...
l1 = (.NOT.(x.EQ.y.AND.a.EQ.b))
l2 = (l1.EQV.((x.GT.a.OR.y.LT.b).NEQV.a.EQ.b))
For more information, click here
Next: Operator Precedence
Up: Expressions and Assignment
Previous: Relational Operators
Adam Marshall ©University of Liverpool, 1996
Fri Dec 6 18:56:08 GMT 1996Not for commercial use.