Clicky

Fortran Wiki
nint (changes)

Skip the Navigation Links | Home Page | All Pages | Recently Revised | Authors | Feeds | Export |

Showing changes from revision #1 to #2: (追記) Added (追記ここまで) | (削除) Removed (削除ここまで) | (削除) Chan (削除ここまで)(追記) ged (追記ここまで)

Description

nint(x) rounds its argument to the nearest whole number.

Standard

(削除) Fortran 77 and later, with (削除ここまで)(追記) FORTRAN 77 (追記ここまで)(追記) and later, with (追記ここまで)kind argument(削除) Fortran (削除ここまで)(削除) 90 (削除ここまで)(削除) and (削除ここまで)(削除) later (削除ここまで)(追記) Fortran 90 (追記ここまで)(追記) and later (追記ここまで)

Class

(削除) Elemental function (削除ここまで)(追記) Elemental function (追記ここまで)

Syntax

result = nint(x [, kind])

Arguments

  • x - 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

See also

ceiling, floor

category: (削除) Intrinsics (削除ここまで)(追記) intrinsics (追記ここまで)

Revised on April 30, 2009 20:18:11 by Jason Blevins (71.70.142.190) (880 characters / 0.0 pages)
Edit | Back in time (1 revision) | Hide changes | History | Views: Print | TeX | Source | Linked from: Intrinsic procedures, ceiling, floor

AltStyle によって変換されたページ (->オリジナル) /