FEHOLDEXCEPT(3M) Mathematical Library Functions FEHOLDEXCEPT(3M)

feholdexcept - save current floating-point environment

c99 [ flag... ] file... -lm [ library... ]
#include <fenv.h>
int feholdexcept(fenv_t *envp);

The feholdexcept() function saves the current floating-point environment in the object pointed to by envp, clears the floating-point status flags, and then installs a non-stop (continue on floating-point exceptions) mode, if available, for all floating-point exceptions.

The feholdexcept() function returns 0 if and only if non-stop floating-point exception handling was successfully installed.

No errors are defined.

See attributes(7) for descriptions of the following attributes:

Interface Stability Standard
MT-Level MT-Safe

fenv.h(3HEAD), fegetenv(3M), feupdateenv(3M), attributes(7), standards(7)

In a multithreaded program, the feholdexcept() function affects the floating point environment only for the calling thread.

The feholdexcept() function automatically installs and deinstalls SIGFPE handlers and sets and clears the trap enable mode bits in the floating point status register as needed. If a program uses these functions and attempts to install a SIGFPE handler or control the trap enable mode bits independently, the resulting behavior is not defined.

July 12, 2006 SunOS 5.11