c/numeric/fenv/FE round

Each of these macro constants expands to a nonnegative integer constant expression, which can be used with fesetround and fegetround to indicate one of the supported floating-point rounding modes. The implementation may define additional rounding mode constants in, which should all begin with followed by at least one uppercase letter. Each macro is only defined if it is supported.

Additional rounding modes may be supported by an implementation.

The current rounding mode affects the following:
 * results of floating-point arithmetic operators outside of constant expressions


 * results of standard library mathematical functions


 * floating-point to floating-point implicit conversion and casts


 * string conversions such as strtod or printf


 * the library rounding functions nearbyint, rint, lrint

The current rounding mode does NOT affect the following:
 * floating-point to integer implicit conversion and casts (always towards zero)
 * results of floating-point arithmetic operators in constant expressions executed at compile time (always to nearest)
 * the library functions round, lround, llround, ceil, floor, trunc

As with any floating-point environment functionality, rounding is only guaranteed if is set.

Compilers that do not support the pragma may offer their own ways to support current rounding mode. For example Clang and GCC have the option intended to disable optimizations that would change the meaning of rounding-sensitive code.