Sun Studio 12: Fortran Library Reference

3.3 Miscellaneous Functions

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

3.3.1 Bit Manipulation ¤

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

Table 3–6 Fortran 77 Bitwise Functions

Bitwise Operations  

No. of Args.  

Specific Name  

Argument Type  

Function Type  

Complement 

1 

NOT

INTEGER

INTEGER

And 

22 

AND IAND

INTEGER

INTEGER

Inclusive or 

22 

OR IOR

INTEGER

INTEGER

Exclusive or 

22 

XOR IEOR

INTEGER

INTEGER

Shift See Note (14).

2 

ISHFT

INTEGER

INTEGER

Left shift See Note (14).

2 

LSHIFT

INTEGER

INTEGER

Right shift See Note (14).

2 

RSHIFT

INTEGER

INTEGER

Logical right shift See Note (14).

2 

LRSHFT

INTEGER

INTEGER

Circular shift 

3 

ISHFTC

INTEGER

INTEGER

Bit extraction 

3 

IBITS

INTEGER

INTEGER

Bit set 

2 

IBSET

INTEGER

INTEGER

Bit test 

2 

BTEST

INTEGER

LOGICAL

Bit clear 

2 

IBCLR

INTEGER

INTEGER

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.

3.3.2 Environmental Inquiry Functions ¤

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

Table 3–7 Fortran 77 Environmental Inquiry Functions

Definition  

No. of Args.  

Generic Name  

Argument Type  

Function Type  

Base of Number System 

1 

EPBASE

INTEGER

REAL

DOUBLE

REAL*16

INTEGER

INTEGER

INTEGER

INTEGER

Number of Significant Bits 

1 

EPPREC

INTEGER

REAL

DOUBLE

REAL*16

INTEGER

INTEGER

INTEGER

INTEGER

Minimum Exponent 

1 

EPEMIN

REAL

DOUBLE

REAL*16

INTEGER

INTEGER

INTEGER

Maximum Exponent 

1 

EPEMAX

REAL

DOUBLE

REAL*16

INTEGER

INTEGER

INTEGER

Least Nonzero Number 

1 

EPTINY

REAL

DOUBLE

REAL*16

REAL

DOUBLE

REAL*16

Largest Number Representable 

1 

EPHUGE

INTEGER

REAL

DOUBLE

REAL*16

INTEGER

REAL

DOUBLE

REAL*16

Epsilon See Note (16).

1 

EPMRSP

REAL

DOUBLE

REAL*16

REAL

DOUBLE

REAL*16

3.3.3 Memory ¤

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

Table 3–8 Fortran 77 Memory Functions

Intrinsic Function  

Definition  

No. of Args  

Specific Name  

Argument Type  

Function Type  

Location 

Address of 

See Note (17).

1 

LOC

Any

INTEGER*4INTEGER*8

Allocate 

Allocate memory and return address. 

See Note (17).

1 

MALLOC

MALLOC64

INTEGER*4

INTEGER*8

INTEGER

INTEGER*8

Deallocate 

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

1 

FREE

Any

- 

Size 

Return the size of the argument in bytes. 

See Note (18).

1 

SIZEOF

Any expression

INTEGER