Chapter Contents

Previous

Next
feholdexcept

feholdexcept



Install a non-trapping floating point environment

Portability: C99


SYNOPSIS
DESCRIPTION
RETURN VALUE
CAUTIONS
RELATED FUNCTIONS
SEE ALSO


SYNOPSIS

   #include <fenv.h>

   int feholdexcept(fenv_t *envp);


DESCRIPTION

feholdexcept is used to save the current floating-point environment and establish a new environment in which no floating-point exceptions are indicated, and in which trapping is not enabled. The existing floating-point environment is stored in the location addressed by the ENVP argument. The floating-point environment includes the exception bits, the rounding mode, and the definition of the exceptions for which trapping is enabled.


RETURN VALUE

feholdexcept returns zero if it was successful, or a non-zero value if it was unable to establish a non-trapping environment.


CAUTIONS

feholdexcept returns -1 when called from a function whose default floating-point format is hexadecimal, that is, one compiled without the bfp option.

A program which calls feholdexcept must use the standard FENV_ACCESS pragma in an enclosing scope, or the effects are unpredictable.


RELATED FUNCTIONS

fegetenv, fesetenv, feupdateenv


SEE ALSO

"Mathematical Functions" in Chapter 2, "Function Categories"


Chapter Contents

Previous

Next

Top of Page

Copyright © 2004 by SAS Institute Inc., Cary, NC, USA. All rights reserved.