Clicky
Showing changes from revision #1 to #2:
(追記) Added (追記ここまで) | (削除) Removed (削除ここまで) | (削除) Chan (削除ここまで)(追記) ged (追記ここまで)
nint(x)
rounds its argument to the nearest whole number.
(削除) Fortran 77 and later, with (削除ここまで)(追記) FORTRAN 77 (追記ここまで)(追記) and later, with (追記ここまで)kind
argument(削除) Fortran (削除ここまで)(削除) 90 (削除ここまで)(削除) and (削除ここまで)(削除) later (削除ここまで)(追記) Fortran 90 (追記ここまで)(追記) and later (追記ここまで)
(削除) Elemental function (削除ここまで)(追記) Elemental function (追記ここまで)
result = nint(x [, kind])
x
- The type of the argument shall be real
.kind
- (Optional) An integer
initialization expression indicating the kind parameter of the result.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.
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