Jump to content United States-English
HP.com Home Products and Services Support and Drivers Solutions How to Buy
» Contact HP
More options
HP.com home
HP-UX Reference (Volume 6 of 9): Section 3: Library Functions (A-M) > f

feholdexcept(3M)

» 

Technical documentation

Complete book in PDF
» Feedback
Content starts here

 » Table of Contents

 » Index

NAME

feholdexcept() — save floating-point environment

SYNOPSIS

#include <fenv.h>

int feholdexcept(fenv_t *envp);

DESCRIPTION

The feholdexcept() function saves the current floating-point environment in the object pointed to by the argument envp, clears the exception flags, and disables all traps.

Use feholdexcept() with feupdateenv() to hide spurious exceptions. Use it with fesetenv() to hide all exceptions.

The ISO/ANSI C committee has approved the feholdexcept() function for inclusion in the C9X draft standard.

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 feholdexcept() function returns a zero value, indicating the successful disabling of any traps.

ERRORS

No errors are defined.

EXAMPLE

Store the current floating-point environment in holdenv, hide spurious underflow exceptions, and continue on any exceptions that occur until the call to feupdateenv() is encountered.

#include <fenv.h> /*...*/ fenv_t holdenv; feholdexcept(&holdenv); /* perform operations */ if (/* test for spurious underflow */) feclearexcept(FE_UNDERFLOW); feupdateenv(&holdenv); /* raise accumulated exceptions */

Printable version
Privacy statement Using this site means you accept its terms Feedback to webmaster
© 1983-2000 Hewlett-Packard Development Company, L.P.