fesetround() — Set the current rounding mode

Standards

Standards / Extensions C or C++ Dependencies

C99
Single UNIX Specification, Version 3
C++ TR1 C99

both  z/OS V1R7

Format

#define _ISOC99_SOURCE
#include <fenv.h>

int fesetround(int round);

General description

fesetround() establishes the rounding mode represented by round. If the argument is not equal to the value of a rounding mode macro, the rounding mode is not changed.
Note: The following table shows the viable formats for these functions. See IEEE binary floating-point for more information about IEEE Binary Floating-Point.
Function Hex IEEE
fesetround   X
Note: This function will not return or update decimal floating-point rounding mode bits. The fe_dec_getround() and fe_dec_setround() functions can be used to get and set the current rounding mode for decimal floating-point operations.

Returned value

If successful, fesetround() returns 0 when round is set to a rounding mode.

Related information