FORTRAN 77 Language Reference

Miscellaneous Functions

Other miscellaneous functions include bitwise functions, environmental inquiry functions, and memory allocation and deallocation functions.

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.

Environmental Inquiry Functions @

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

Table 6-7 Environmental Inquiry Functions

Definition 

No. of Args. 

Generic Name 

Argument Type 

Function Type 

Base of Number System 

EPBASE INTEGER REAL DOUBLE REAL*16INTEGER INTEGER INTEGER INTEGER

Number of Significant Bits 

EPPREC INTEGER REAL DOUBLE REAL*16INTEGER INTEGER INTEGER INTEGER

Minimum Exponent 

EPEMIN REAL DOUBLE REAL*16INTEGER INTEGER INTEGER

Maximum Exponent 

EPEMAX REAL DOUBLE REAL*16INTEGER INTEGER INTEGER

Least Nonzero Number 

EPTINY REAL DOUBLE REAL*16REAL DOUBLE REAL*16

Largest Number Representable 

EPHUGE INTEGER REAL DOUBLE REAL*16INTEGER REAL DOUBLE REAL*16

Epsilon See Note (16).

EPMRSP REAL DOUBLE REAL*16REAL DOUBLE REAL*16

Memory @

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

Table 6-8 Memory Functions

Intrinsic Function 

Definition 

No. of Args 

Specific Name 

Argument Type 

Function Type 

Location 

Address of 

See Note (17).

LOC AnyINTEGER*4 INTEGER*8

Allocate 

Allocate memory and return address. 

See Note (17).

MALLOC MALLOC64 INTEGER*4 INTEGER*8INTEGER INTEGER*8

Deallocate 

Deallocate memory allocated by MALLOC. See Note (17).

FREE Any -

Size 

Return the size of the argument in bytes. 

See Note (18).

SIZEOF

Any expression

INTEGER

Although malloc and free are not, strictly speaking, intrinsics, they are listed here and in the Fortran Library Reference.