ANINT — Nearest whole number#
-
ANINT(A[
, KIND])# ANINT(A [, KIND])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:
The return value is of type real with the kind type parameter of the argument if the optional
KINDis absent; otherwise, the kind type parameter will be given byKIND. IfAis greater than zero,ANINT(A)returnsAINT(X+0.5). IfAis less than or equal to zero then it returnsAINT(X-0.5).
- Standard:
Fortran 77 and later
- Class:
Elemental function
- Syntax:
RESULT = ANINT(A [, KIND])
- 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
ANINT(A)REAL(4) AREAL(4)Fortran 77 and later
DNINT(A)REAL(8) AREAL(8)Fortran 77 and later