Next: Intrinsic Character Operations
Up: Expressions and Assignment
Previous: Relational Operators
A LOGICAL or boolean expression returns a .TRUE. / .FALSE. result. The
following operators are valid with LOGICAL operands,
- .NOT. -- monadic negation operator which gives .TRUE. if operand
is .FALSE., for example, .NOT.(a .LT. b).
- .AND. -- logical and operator. .TRUE. if both operands are
.TRUE..
- .OR. -- logical or operator. .TRUE. if at least one operand is
.TRUE..
- .EQV. -- .TRUE. if both operands are the same.
- .NEQV. -- .TRUE. if both operands are different.
The following are examples of logical expressions,
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))
Return to corresponding overview page
Next: Intrinsic Character Operations
Up: Expressions and Assignment
Previous: Relational Operators
©University of Liverpool, 1997
Wed May 28 20:20:27 BST 1997Not for commercial use.