ieee_rint
- Date:
10-12-2011
NAME
IEEE_RINT - Converts x to an integral value
SYNOPSIS
IEEE_RINT ([X=]x)
IMPLEMENTATION
Cray Linux Environment (CLE)
STANDARDS
Fortran
IEEE Standard for Binary Floating-point Arithmetic
DESCRIPTION
The IEEE_RINT intrinsic function converts x to an integral value according to the rounding mode currently in effect. It accepts the following argument:
- x
Must be of type real.
IEEE_RINT is an elemental function. The name of this intrinsic cannot be passed as an argument.
IEEE_RINT will not be invoked if the value of IEEE_SUPPORT_DATATYPE(x) is false.
NOTES
The IEEE intrinsic procedures use the named constants contained in a system module, so you must include the following statement in your program:
USE, INTRINSIC :: IEEE_ARITHMETIC
RETURN VALUES
The result type and type parameters are the same as x. The value of the result is the value of x rounded to an integral value according to the rounding mode current in effect. If the result is zero, the sign is the sign of x.
EXAMPLES
Example 1:
USE, INTRINSIC :: IEEE_ARITHMETIC
TYPE(IEEE_ROUND_TYPE) rnd_val
REAL x
x = 1.1
PRINT *, x
CALL IEEE_GET_ROUNDING_MODE(rnd_val)
CALL IEEE_SET_ROUNDING_MODE(IEEE_NEAREST)
PRINT *, IEEE_RINT(x)
CALL IEEE_SET_ROUNDING_MODE(rnd_val)
END
SEE ALSO
ieee_get_rounding_mode(3i), ieee_set_rounding_mode(3i), ieee_support_datatype(3i), ieee_support_rounding(3i)