ANINT(3f)

DESCRIPTION
ANINT(A [, KIND]) rounds its argument to the nearest whole number.

STANDARD
Fortran 77 and later

CLASS
Elemental function

SYNTAX
RESULT = ANINT(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
The return value is of type real with the kind type parameter of the argument if the optional KIND is absent; otherwise, the kind type parameter will be given by KIND. If A is greater than zero, ANINT(A) returns AINT(X+0.5). If A is less than or equal to zero then it returns AINT(X-0.5).

EXAMPLE
          program test_anint
            real(4) x4
            real(8) x8
            x4 = 1.234E0_4
            x8 = 4.321_8
            print *, anint(x4), dnint(x8)
            x8 = anint(x4,8)
          end program test_anint

SPECIFIC NAMES

Name Argument Return type Standard AINT(A) REAL(4) A REAL(4) Fortran 77 and later DNINT(A) REAL(8) A REAL(8) Fortran 77 and later

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).