fegetround, fesetround

From cppreference.com
< c‎ | numeric‎ | fenv
Defined in header <fenv.h>
int fesetround( int round );
(1) (since C99)
int fegetround();
(2) (since C99)

1) Attempts to establish the floating-point rounding direction equal to the argument argument round, which is expected to be one of the floating point rounding macros.

2) Returns the value of the floating point rounding macro that corresponds to the current rounding direction.

Parameters

round - rounding direction, one of floating point rounding macros

Return value

1) 0 on success, non-zero otherwise.

2) the floating point rounding macro describing the current rounding direction or a negative value if the direction cannot be determined.

Notes

The current rounding mode, reflecting the effects of the most recent fesetround, can also be queried with FLT_ROUNDS.