HP-UX Reference (11i v1 05/09) - 3 Library Functions A-M (vol 6)
f
fesetenv(3M) fesetenv(3M)
NAME
fesetenv( ) - set floating-point environment
SYNOPSIS
#include <fenv.h>
void fesetenv(const fenv_t *envp);
DESCRIPTION
The fesetenv() function establishes the floating-point environment represented by the object pointed to
by envp. The argument envp must point to an object set by a call to
fegetenv() or feholdex-
cept()
, or equal the macro FE_DFL_ENV .
Note that
fesetenv() merely installs the state of the exception flags represented through its argument,
and does not raise these exceptions.
The ISO/ANSI C committee has approved the
fesetenv() function for inclusion in the C9X draft stan-
dard.
To use this function, compile either with the default
-Ae option or with the -Aa
and -D_HPUX_SOURCE
options. Make sure your program includes <fenv.h>. Link in the math library by specifying
-lm on the
compiler or linker command line.
For more information, see the HP-UX Floating-Point Guide.
RETURN VALUE
None.
ERRORS
No errors are defined.
EXAMPLES
Store the current floating-point environment, continue on exceptions, then restore the previous environ-
ment without raising the accumulated exceptions.
#include <fenv.h>
/*...*/
fenv_t holdenv;
feholdexcept(&holdenv);
/* perform operations */
fesetenv(&holdenv);
Restore the default environment:
#include <fenv.h>
/*...*/
fesetenv(FE_DFL_ENV);
SEE ALSO
fegetenv(3M), feholdexcept(3M), feupdateenv(3M), fenv(5).
Section 3−−252 Hewlett-Packard Company − 1 − HP-UX 11i Version 1: September 2005