NINT(3f)

DESCRIPTION
NINT(A) rounds its argument to the nearest whole number.

STANDARD
Fortran 77 and later, with KIND argument Fortran 90 and later

CLASS
Elemental function

SYNTAX
RESULT = NINT(A [, KIND])

ARGUMENTS

A The type of the argument shall be REAL. KIND (Optional) An INTEGER initialization expression indicating the kind parameter of the result.

RETURN VALUE
Returns A with the fractional portion of its magnitude eliminated by rounding to the nearest whole number and with its sign preserved, converted to an INTEGER of the default 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) A INTEGER Fortran 95 and later IDNINT(A) REAL(8) A INTEGER Fortran 95 and later

SEE ALSO
CEILING, FLOOR

AUTHOR

This information was taken from the GFortran documentation (https://gcc.gnu.org/onlinedocs/gcc-5.3.0/gfortran/) and converted to a manpage by AstroFloyd (http://astrofloyd.org).