Visible to Intel only — GUID: GUID-0FECEFAF-1B72-4884-BD48-6A6AF4B32960
Visible to Intel only — GUID: GUID-0FECEFAF-1B72-4884-BD48-6A6AF4B32960
IEEE_RINT
Elemental Module Intrinsic Function (Generic): Returns an integer value rounded according to the current rounding mode.
Module
USE, INTRINSIC :: IEEE_ARITHMETIC
result = IEEE_RINT (x [, round])
x |
(Input) Must be of type REAL. |
round |
(Input; optional) Must be of type TYPE (IEEE_ROUND_TYPE). |
Results
The result type and kind are the same as x.
The value of the result is x rounded to an integer according to the current rounding mode if round is not present. If round is present, the value of the result is x rounded to an integer according to the mode specified by round; this is the operation roundToInteger (rounding) as specified by ISO/IEC 60559:2020.
If the result value is zero, the sign is the same as x.
The rounding mode specified by round, if present, is used to perform the conversion. The rounding mode before and after the call remains unchanged.
Example
If the current rounding mode is IEEE_UP, the value of IEEE_RINT (2.2) is 3.0.
If the current rounding mode is IEEE_NEAREST, the value of IEEE_RINT (2.2) is 2.0.
The value of IEEE_RINT (7.4, IEEE_DOWN) is 7.0.