![The C Standard Library Reference](/c_standard_library/images/c-mini-logo.jpg)
- The C Standard Library
- C Library - Home
- C Library - <assert.h>
- C Library - <complex.h>
- C Library - <ctype.h>
- C Library - <errno.h>
- C Library - <fenv.h>
- C Library - <float.h>
- C Library - <inttypes.h>
- C Library - <iso646.h>
- C Library - <limits.h>
- C Library - <locale.h>
- C Library - <math.h>
- C Library - <setjmp.h>
- C Library - <signal.h>
- C Library - <stdalign.h>
- C Library - <stdarg.h>
- C Library - <stdbool.h>
- C Library - <stddef.h>
- C Library - <stdio.h>
- C Library - <stdlib.h>
- C Library - <string.h>
- C Library - <tgmath.h>
- C Library - <time.h>
- C Library - <wctype.h>
- C Standard Library Resources
- C Library - Quick Guide
- C Library - Useful Resources
- C Library - Discussion
- C Programming Resources
- C Programming - Tutorial
- C - Useful Resources
C Library - <fenv.h>
The fenv.h header file is part of the standard C library, defines various functions and macros for manipulating the floating-point environment. It allows us to control aspects related to floating-point arithmetic, like exception handling and rounding modes.
C − fenv.h Types
Following are the types defined in the header fenv.h −
Sr.No. | Types & Description |
---|---|
1 |
fenv_t This type represents the entire floating-point environment. |
2 |
fexcept_t This type represents all floating-point status flags collectively. |
Library Functions
Following are the functions defined in the header fenv.h −
Sr.No. | Function & Description |
---|---|
1 |
int feclearexcept( int excepts )
This function clears the specified floating-point status flags. |
2 |
int fetestexcept( int excepts )
This function determines which of the specified floating-point status flags are set. |
3 |
int feraiseexcept(int excepts)
This function raises the specified floating-point exceptions. |
4 |
int fegetexceptflag( fexcept_t* flagp, int excepts )
This function retrieves the full contents of the floating-point exception flags. |
5 |
int fesetexceptflag(const fexcept_t *flagp, int excepts)
This function sets the contents of the floating-point exception flags. |
6 |
int fegetround()
This function retrieves the rounding direction. |
7 |
int fesetround( int round )
This function sets the rounding direction. |
8 |
int fegetenv( fenv_t* envp )
This function attempts to store the status of the floating-point environment in the object pointed to by envp. |
9 |
int fesetenv( const fenv_t* envp )
This function attempts to establish the floating-point environment from the object pointed to by envp. |
10 |
int feholdexcept( fenv_t* envp )
This function saves the environment, clears all status flags and ignores all future errors. |
11 |
int feupdateenv( const fenv_t* envp )
This function restores the floating-point environment and raises the previously raise exceptions. |