NINT — Nearest whole number#
-
NINT(A)#
NINT(A)rounds its argument to the nearest whole number.- Parameters:
A – The type of the argument shall be
REAL.KIND – (Optional) An
INTEGERinitialization expression indicating the kind parameter of the result.
- Returns:
Returns
Awith the fractional portion of its magnitude eliminated by rounding to the nearest whole number and with its sign preserved, converted to anINTEGERof the default kind.
- Standard:
Fortran 77 and later, with
KINDargument Fortran 90 and later- Class:
Elemental function
- Syntax:
RESULT = NINT(A [, KIND])
- Example:
program test_nint real(4) x4 real(8) x8 x4 = 1.234E0_4 x8 = 4.321_8 print *, nint(x4), idnint(x8) end program test_nint
- Specific names:
Name
Argument
Return Type
Standard
NINT(A)REAL(4) AINTEGERFortran 77 and later
IDNINT(A)REAL(8) AINTEGERFortran 77 and later
- See also:
CEILING — Integer ceiling function, FLOOR — Integer floor function