HP-UX Reference (11i v1 05/09) - 3 Library Functions A-M (vol 6)
f
fegettrapenable(3M) fegettrapenable(3M)
NAME
fegettrapenable() - get exception trap enable bits
SYNOPSIS
#include <fenv.h>
int fegettrapenable(void);
DESCRIPTION
The fegettrapenable()
function determines which exception trap enable bits are currently set.
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
The
fegettrapenable()
function returns the bitwise OR of the exception macros corresponding to the
currently set exception trap enable bits. The macros are
FE_INEXACT , FE_DIVBYZERO ,
FE_UNDERFLOW , FE_OVERFLOW , and FE_INVALID . FE_ALL_EXCEPT
represents all the exceptions.
ERRORS
No errors are defined.
EXAMPLE
Retrieve the current trap settings and determine whether a trap for the divide by zero exception is enabled.
#include <fenv.h>
/*...*/
if (fegettrapenable() & FE_DIVBYZERO)
printf("divide by zero trap set\\n");
AUTHOR
fegettrapenable()
was developed by HP and is not required by any current standard.
SEE ALSO
feclearexcept(3M), fegetexceptflag(3M), feraiseexcept(3M), fesetexceptflag(3M), fesettrapenable(3M),
fenv(5).
HP-UX 11i Version 1: September 2005 − 1 − Hewlett-Packard Company Section 3−−247