NAME
fegetmode, fesetmode – save and restore floating-point control modes
LIBRARY
Math Library (libm, -lm)
SYNOPSIS
#include <fenv.h>
#pragma STDC FENV_ACCESS ON
int
fegetmode(femode_t *modep);
int
fesetmode(const femode_t *modep);
DESCRIPTION
The femode_t type represents the dynamic floating-point control modes, including the rounding direction and, where supported, exception masks and other implementation-defined modes.
The fegetmode() function stores the current control modes in the object pointed to by modep.
The fesetmode() function establishes the control modes represented by modep. The argument modep must point to an object set by a prior call to fegetmode(), or equal FE_DFL_MODE. FE_DFL_MODE expands to a pointer to the default control modes( installed at program startup).
RETURN VALUES
The fegetmode() and fesetmode() functions return 0 if they succeed, and non-zero otherwise; however, the present implementation always succeeds.
SEE ALSO
STANDARDS
The fegetmode() and fesetmode() functions conform to ISO/IEC 9899:2024 (“ISO C23”).
HISTORY
These routines first appeared in FreeBSD 16.0.