HPlogo HP-UX Reference Volume 4 of 5 > f

fegettrapenable(3M)

» 

Technical documentation

Complete book in PDF

 » Table of Contents

 » Index

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.

© Hewlett-Packard Development Company, L.P.