bool(3F) bool(3F)
NAME
and, or, xor, not, lshift, rshift, lshiftl, rshiftl,
lshifta, rshifta - Fortran bitwise boolean functions
SYNOPSIS
integer i, j, k
integer*2 i2, j2, k2
k = and(i, j)
k2 = and(i2, j2)
k = or(i, j)
k2 = or(i2, j2)
k = xor(i, j)
k2 = xor(i2, j2)
j = not(i)
j2 = not(i2)
k = lshift(i, j)
k = lshift(i2, j2)
k = rshift(i, j)
k = rshift(i2, j2)
k = lshiftl(i, j)
k = lshiftl(i2, j2)
k = rshiftl(i, j)
k = rshiftl(i2, j2)
k = lshifta(i, j)
k = lshifta(i2, j2)
k = rshifta(i, j)
k = rshifta(i2, j2)
DESCRIPTION
The generic intrinsic boolean functions and, or and xor
return the value of the binary operations on their argu-
ments. not is a unary operator returning the one's comple-
ment of its argument. lshift and lshiftl return the value
of the first argument logically shifted left the number of
times specified by the second (integer) argument. rshift
and rshifta return the value of the first argument arithmet-
ically shifted right the number of times specified by the
second (integer) argument. rshiftl returns the value of the
first argument logically shifted right the number of times
specified by the second (integer) argument. lshifta returns
the value of the first argument arithmetically shifted left
the number of times specified by the second (integer) argu-
ment.
NOTE
Although defined for all data types, use of boolean func-
tions on any but integer data is bizarre and will probably
result in unexpected consequences.
BUGS
The implementation of the shift functions may cause large
Page 1 CX/UX Hf77 Fortran Reference Manual
bool(3F) bool(3F)
shift values to deliver weird results.
Page 2 CX/UX Hf77 Fortran Reference Manual