FORTRAN Reference Manual

Intrinsic Functions
FORTRAN Reference Manual528615-001
8-26
NINT Function
NINT Function
The NINT function returns the integer that is closest to the value of its argument.
The table below shows the argument and function type of the NINT generic function
and its associated specific functions:
Considerations
If x is zero, NINT returns zero.
If x is greater than zero, NINT returns:
INT ( x + 0.5)
If x is less than zero, NINT returns:
INT ( x - 0.5)
Example of the NINT Function
DOUBLE PRECISION tonnage
INTEGER * 8 volume
volume = IDNINT8 (tonnage)
REAL Function
The REAL function returns a real type value.
The table below describes the argument and function type of the generic REAL
function and of its associated specific functions.
Syntax Argument Type Function Type
NINT (x) Real Integer
NINT4 (x) Real Integer*4
NINT8 (x) Real Integer*8
IDNINT (x) Double Precision Integer
IDNINT4 (x) Double Precision Integer*4
IDNINT8 (x) Double Precision Integer*8
x is an arithmetic expression.
Syntax Argument Type Function Type
REAL (x) Integer Real
FLOAT (x) Integer Real
SNGL (x) Double Precision Real
x is an arithmetic expression.