FORTRAN 77 Language Reference

Bit Manipulation @

None of these functions are part of the FORTRAN 77 Standard.

Table 6-6 Bitwise Functions

Bitwise Operations 

No. of Args. 

Specific Name 

Argument Type 

Function Type 

Complement 

NOT INTEGERINTEGER

And 

2 2 

AND IAND INTEGER INTEGERINTEGER INTEGER

Inclusive or 

2 2 

OR IOR INTEGER INTEGERINTEGER INTEGER

Exclusive or 

2 2 

XOR IEOR INTEGER INTEGERINTEGER INTEGER

Shift See Note (14).

ISHFT INTEGERINTEGER

Left shift See Note (14).

LSHIFT INTEGERINTEGER

Right shift See Note (14).

RSHIFT INTEGERINTEGER

Logical right shift See Note (14).

LRSHFT INTEGERINTEGER

Circular shift 

ISHFTC INTEGERINTEGER

Bit extraction 

IBITS INTEGERINTEGER

Bit set 

IBSET INTEGERINTEGER

Bit test 

BTEST INTEGERLOGICAL

Bit clear 

IBCLR INTEGERINTEGER

The above functions are available as intrinsic or extrinsic functions. See also the discussion of the library bit manipulation routines in the Fortran Library Reference manual.