Search:

FEGETROUND(3) DragonFly Library Functions Manual FEGETROUND(3)## NAME

fegetround,fesetround-- control floating-point rounding direction modes## SYNOPSIS

#include<fenv.h>intfegetround(void);intfesetround(intround);## DESCRIPTION

These functions provide control of floating-point rounding direction modes. Theroundinput argument is a value specifying a rounding direc- tion mode and containing any of the values listed below. FE_TONEAREST Results are rounded to the closest representable value. If the exact result is exactly half way between two repre- sentable values, the value whose last binary digit is even (zero) is chosen. This is the default mode. FE_DOWNWARD Results are rounded towards negative infinity. FE_UPWARD Results are rounded towards positive infinity. FE_TOWARDZERO Results are rounded towards zero. Thefegetround() function gets the current rounding direction. Thefesetround() function establishes the rounding direction represented byround. If the argument is not equal to the value of a rounding direc- tion macro, the rounding direction is not changed.## RETURN VALUES

Thefegetround() function returns the current rounding direction. Thefesetround() function return zero on success, and non-zero if an error occurred.## SEE ALSO

feclearexcept(3), feenableexcept(3), fegetenv(3)## STANDARDS

Thefegetround() andfesetround() functions conform to ISO/IEC 9899:1999 (``ISO C99'').## HISTORY

These functions first appeared in OpenBSD 5.0. DragonFly 4.9 June 5, 2013 DragonFly 4.9

Search: