BIT(3F) — FORTRAN LIBRARY ROUTINES
NAME
bit, and, or, xor, not, rshift, lshift, bic, bis, bit, setbit − bitwise operator functions
SYNOPSIS
(generic) function and (word1, word2)
(generic) function or (word1, word2)
(generic) function xor (word1, word2)
(generic) function not (word)
(generic) function rshift (word, nbits)
(generic) function lshift (word, nbits)
subroutine bic (bitnum, word)
integer∗4 bitnum, word
subroutine bis (bitnum, word)
integer∗4 bitnum, word
subroutine setbit (bitnum, word, state)
integer∗4 bitnum, word, state
logical function bit (bitnum, word)
integer∗4 bitnum, word
DESCRIPTION
The and, or, xor, not, rshift, and lshift functions are generic functions expanded inline by the compiler. Their arguments must be integer or logical values (short or long). The returned value has the data type of the first argument.
and computes the bitwise and of its arguments.
or computes the bitwise OR of its arguments.
xor computes the bitwise exclusive-OR of its arguments.
not returns the bitwise complement of its argument.
lshift is a logical left-shift with no end around carry.
rshift is an arithmetic right-shift with sign extension. No test is made for a reasonable value of nbits.
bic, bis, and setbit are external subroutines which operate on integer∗4 arguments.
bis sets bitnum in word.
bic clears bitnum in word.
setbit sets bitnum in word to 1 if state is nonzero and clears it otherwise.
bit is an external function that tests bitnum in word and returns .true. if bitnum is a "1", and returns .false. if bitnum is a "0".
FILES
/usr/lib/libF77.a
Sun Release 3.2 — Last change: 17 July 1986