ieee_support_rounding

Date:

10-12-2011

NAME

IEEE_SUPPORT_ROUNDING - Determinesif the system supports a specific IEEE rounding mode for real variables

SYNOPSIS

IEEE_SUPPORT_ROUNDING ([ROUND_VALUE=]round_value [,[X=]x])

IMPLEMENTATION

Cray Linux Environment (CLE)

STANDARDS

Fortran

IEEE Standard for Binary Floating-point Arithmetic

DESCRIPTION

The function IEEE_SUPPORT_ROUNDING() can be used to determine if a system supports a specific IEEE rounding mode for a particular kind of real or for all reals. A call to subroutine IEEE_SET_ROUNDING_MODE() with a rounding mode will change the rounding mode to that mode if the system supports the ability to change the rounding mode.

This function accepts the following argument:

round_value

Must be of type TYPE(IEEE_ROUND_TYPE). The values for round_value may be one of the named constants:

  • IEEE_DOWN

  • IEEE_NEAREST

  • IEEE_OTHER

  • IEEE_TO_ZERO

  • IEEE_UP

x

Must be of type real. It may be a scalar or an array.

IEEE_SUPPORT_ROUNDING() is an inquiry function. The name of this intrinsic cannot be passed as an argument.

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 parameter is default logical. If x is present, the result is true if the system supports the specified IEEE rounding mode defined by round_value for real variables of the same kind type as x; otherwise, the result is false.

EXAMPLES

Example 1:

USE, INTRINSIC :: IEEE_ARITHMETIC
REAL xdef
REAL(8) x8
LOGICAL x_round_near_supported, allx_round_down_supported
TYPE(IEEE_ROUND_TYPE) :: round_nearest_flag = IEEE_NEAREST

x_round_near_supported = IEEE_SUPPORT_ROUNDING(round_nearest_flag,xdef)

allx_round_down_supported = IEEE_SUPPORT_ROUNDING(IEEE_DOWN)

SEE ALSO

ieee_set_rounding(3i)