Important: The information in this document is obsolete and should not be used for new development.
fesetexcept
You can use thefesetexcept
function to restore the values of the floating-point exception flags previously saved by a call tofegetexcept
.
void fesetexcept (const fexcept_t *flagp, int excepts);
flagp
- A pointer to the values the floating-point exception flags should have.
excepts
- A mask indicating which exception flags should have their values changed.
DESCRIPTION
Thefesetexcept
function sets the floating-point exception flags indicated by the argumentexcepts
to the values indicated by the argumentflagp
. Theexcepts
argument may be one of the constants in Table 8-2 on page 8-6, two or more of these constants ORed together, or the constantFE_ALL_EXCEPT
.You must call
fegetexcept
before this function to set theflagp
argument. This argument cannot be set in any other way.EXAMPLES
fesetexcept(flagp, FE_INVALID); /* restores the invalid flag */ fesetexcept(flagp, FE_INVALID|FE_OVERFLOW|FE_DIVBYZERO); /* restores the invalid, overflow, and divide-by-zero flags */ fesetexcept(flagp, FE_ALL_EXCEPT); /* restores all flags */