< C Programming
fenv.h
is a header file containing various functions and macros for manipulating the floating-point environment.[1]
This header declares two types, fenv_t
(represents the whole floating-point environment) and fexcept_t
(represents the floating-point status flags).[1] It also declares several feature macros, beginning with FE_
and a capital letter.
Functions
Other than fegetround
and fetestexcept
, these functions return zero/non-zero on success/failure.
Declaration | Description |
---|---|
int (int excepts); | clear exceptions specified by excepts |
int (fenv_t *penv); | store current floating-point environment in penv |
int (fexcept_t *pflag, int excepts); | store current status flags in pflags |
int (void); | retrieve current rounding direction |
int (fenv_t *penv); | save current floating-point environment to penv and clear all exceptions |
int (int excepts); | raise floating-point exceptions |
int (const fenv_t *penv); | set current floating-point environment to penv |
int (const fexcept_t *pflags, int excepts); | set current status flags to those stored in pflags |
int (int round); | set current rounding direction to round |
int (int excepts); | test whether certain exceptions have been raised |
int (const fenv_t *penv); | restore floating-point environment penv, but keep current exceptions |
int fesetprec(int prec) | Sets the precision mode to the value specified by prec. |
References
This article is issued from Wikibooks. The text is licensed under Creative Commons - Attribution - Sharealike. Additional terms may apply for the media files.