fegetround, fesetround

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

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.

Contents

[edit] Parameters

round - rounding direction, one of floating point rounding macros

[edit] 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

[edit] Example

[edit] See also

(C99)
nearest integer using current rounding mode
(function)
(C99)
(C99)
(C99)
nearest integer using current rounding mode with
exception if the result differs
(function)